Class: Net::Llm::VertexAI
- Inherits:
-
Object
- Object
- Net::Llm::VertexAI
- Defined in:
- lib/net/llm/vertex_ai.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(project_id: ENV.fetch("GOOGLE_CLOUD_PROJECT"), region: ENV.fetch("GOOGLE_CLOUD_REGION", "us-east5"), model: "claude-opus-4-5@20251101", http: Net::Llm.http) ⇒ VertexAI
constructor
A new instance of VertexAI.
- #messages ⇒ Object
Constructor Details
#initialize(project_id: ENV.fetch("GOOGLE_CLOUD_PROJECT"), region: ENV.fetch("GOOGLE_CLOUD_REGION", "us-east5"), model: "claude-opus-4-5@20251101", http: Net::Llm.http) ⇒ VertexAI
Returns a new instance of VertexAI.
8 9 10 11 12 13 |
# File 'lib/net/llm/vertex_ai.rb', line 8 def initialize(project_id: ENV.fetch("GOOGLE_CLOUD_PROJECT"), region: ENV.fetch("GOOGLE_CLOUD_REGION", "us-east5"), model: "claude-opus-4-5@20251101", http: Net::Llm.http) @project_id = project_id @region = region @model = model @handler = build_handler(http) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
6 7 8 |
# File 'lib/net/llm/vertex_ai.rb', line 6 def model @model end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/net/llm/vertex_ai.rb', line 6 def project_id @project_id end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
6 7 8 |
# File 'lib/net/llm/vertex_ai.rb', line 6 def region @region end |
Instance Method Details
#fetch ⇒ Object
16 |
# File 'lib/net/llm/vertex_ai.rb', line 16 def fetch(...) = @handler.fetch(...) |
#messages ⇒ Object
15 |
# File 'lib/net/llm/vertex_ai.rb', line 15 def (...) = @handler.(...) |