Class: Langsmith::Project
- Inherits:
-
Object
- Object
- Langsmith::Project
- Defined in:
- lib/langsmith/project.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Instance Method Summary collapse
-
#create_run(name:, run_type:, inputs: {}, extra: {}) ⇒ Langsmith::Run
Create a new run in this project.
-
#initialize(client, data) ⇒ Project
constructor
Initialize a new Project instance.
-
#list_runs(run_type: nil, limit: 100) ⇒ Array<Langsmith::Run>
List runs in this project.
Constructor Details
#initialize(client, data) ⇒ Project
Initialize a new Project instance
11 12 13 14 15 16 17 18 |
# File 'lib/langsmith/project.rb', line 11 def initialize(client, data) @client = client @id = data["id"] @name = data["name"] @description = data["description"] @created_at = data["created_at"] ? Time.parse(data["created_at"]) : nil @tenant_id = data["tenant_id"] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/langsmith/project.rb', line 5 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/langsmith/project.rb', line 5 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/langsmith/project.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/langsmith/project.rb', line 5 def name @name end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
5 6 7 |
# File 'lib/langsmith/project.rb', line 5 def tenant_id @tenant_id end |
Instance Method Details
#create_run(name:, run_type:, inputs: {}, extra: {}) ⇒ Langsmith::Run
Create a new run in this project
27 28 29 |
# File 'lib/langsmith/project.rb', line 27 def create_run(name:, run_type:, inputs: {}, extra: {}) @client.create_run(name: name, run_type: run_type, project_name: @name, inputs: inputs, extra: extra) end |
#list_runs(run_type: nil, limit: 100) ⇒ Array<Langsmith::Run>
List runs in this project
36 37 38 |
# File 'lib/langsmith/project.rb', line 36 def list_runs(run_type: nil, limit: 100) @client.list_runs(project_name: @name, run_type: run_type, limit: limit) end |