Module: TurnKit
- Defined in:
- lib/turnkit.rb,
lib/turnkit/id.rb,
lib/turnkit/tool.rb,
lib/turnkit/turn.rb,
lib/turnkit/agent.rb,
lib/turnkit/clock.rb,
lib/turnkit/error.rb,
lib/turnkit/skill.rb,
lib/turnkit/store.rb,
lib/turnkit/usage.rb,
lib/turnkit/budget.rb,
lib/turnkit/client.rb,
lib/turnkit/record.rb,
lib/turnkit/result.rb,
lib/turnkit/message.rb,
lib/turnkit/version.rb,
lib/turnkit/tool_call.rb,
lib/turnkit/tool_runner.rb,
lib/turnkit/conversation.rb,
lib/turnkit/memory_store.rb,
lib/turnkit/rails/railtie.rb,
lib/turnkit/system_prompt.rb,
lib/turnkit/sub_agent_tool.rb,
lib/turnkit/tool_execution.rb,
lib/turnkit/adapters/ruby_llm.rb,
lib/turnkit/message_projection.rb,
lib/turnkit/stores/active_record_store.rb,
lib/turnkit/generators/turnkit/install_generator.rb
Defined Under Namespace
Modules: Adapters, Clock, Generators, Id, Record Classes: ActiveRecordStore, Agent, Budget, Client, ConfigError, Conversation, Error, MemoryStore, Message, MessageProjection, Railtie, Result, Skill, Store, StoreError, SubAgentTool, SystemPrompt, Tool, ToolCall, ToolContext, ToolError, ToolExecution, ToolRunner, Turn, Usage
Constant Summary collapse
- VERSION =
"0.2.0"
Class Attribute Summary collapse
-
.available_skills ⇒ Object
Returns the value of attribute available_skills.
-
.client ⇒ Object
Returns the value of attribute client.
-
.conversation_record_class ⇒ Object
Returns the value of attribute conversation_record_class.
-
.cost_limit ⇒ Object
Returns the value of attribute cost_limit.
-
.default_model ⇒ Object
Returns the value of attribute default_model.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.max_depth ⇒ Object
Returns the value of attribute max_depth.
-
.max_iterations ⇒ Object
Returns the value of attribute max_iterations.
-
.max_tool_executions ⇒ Object
Returns the value of attribute max_tool_executions.
-
.message_record_class ⇒ Object
Returns the value of attribute message_record_class.
-
.prompt_behavior ⇒ Object
Returns the value of attribute prompt_behavior.
-
.prompt_sections ⇒ Object
Returns the value of attribute prompt_sections.
-
.store ⇒ Object
Returns the value of attribute store.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
-
.tool_execution_record_class ⇒ Object
Returns the value of attribute tool_execution_record_class.
-
.turn_record_class ⇒ Object
Returns the value of attribute turn_record_class.
Class Method Summary collapse
Class Attribute Details
.available_skills ⇒ Object
Returns the value of attribute available_skills.
41 42 43 |
# File 'lib/turnkit.rb', line 41 def available_skills @available_skills end |
.client ⇒ Object
Returns the value of attribute client.
38 39 40 |
# File 'lib/turnkit.rb', line 38 def client @client end |
.conversation_record_class ⇒ Object
Returns the value of attribute conversation_record_class.
42 43 44 |
# File 'lib/turnkit.rb', line 42 def conversation_record_class @conversation_record_class end |
.cost_limit ⇒ Object
Returns the value of attribute cost_limit.
40 41 42 |
# File 'lib/turnkit.rb', line 40 def cost_limit @cost_limit end |
.default_model ⇒ Object
Returns the value of attribute default_model.
38 39 40 |
# File 'lib/turnkit.rb', line 38 def default_model @default_model end |
.logger ⇒ Object
Returns the value of attribute logger.
38 39 40 |
# File 'lib/turnkit.rb', line 38 def logger @logger end |
.max_depth ⇒ Object
Returns the value of attribute max_depth.
39 40 41 |
# File 'lib/turnkit.rb', line 39 def max_depth @max_depth end |
.max_iterations ⇒ Object
Returns the value of attribute max_iterations.
39 40 41 |
# File 'lib/turnkit.rb', line 39 def max_iterations @max_iterations end |
.max_tool_executions ⇒ Object
Returns the value of attribute max_tool_executions.
39 40 41 |
# File 'lib/turnkit.rb', line 39 def max_tool_executions @max_tool_executions end |
.message_record_class ⇒ Object
Returns the value of attribute message_record_class.
43 44 45 |
# File 'lib/turnkit.rb', line 43 def @message_record_class end |
.prompt_behavior ⇒ Object
Returns the value of attribute prompt_behavior.
41 42 43 |
# File 'lib/turnkit.rb', line 41 def prompt_behavior @prompt_behavior end |
.prompt_sections ⇒ Object
Returns the value of attribute prompt_sections.
41 42 43 |
# File 'lib/turnkit.rb', line 41 def prompt_sections @prompt_sections end |
.store ⇒ Object
Returns the value of attribute store.
38 39 40 |
# File 'lib/turnkit.rb', line 38 def store @store end |
.timeout ⇒ Object
Returns the value of attribute timeout.
39 40 41 |
# File 'lib/turnkit.rb', line 39 def timeout @timeout end |
.tool_execution_record_class ⇒ Object
Returns the value of attribute tool_execution_record_class.
43 44 45 |
# File 'lib/turnkit.rb', line 43 def tool_execution_record_class @tool_execution_record_class end |
.turn_record_class ⇒ Object
Returns the value of attribute turn_record_class.
42 43 44 |
# File 'lib/turnkit.rb', line 42 def turn_record_class @turn_record_class end |
Class Method Details
.reconcile_stale!(before: Clock.now - (timeout || 300)) ⇒ Object
56 57 58 59 60 |
# File 'lib/turnkit.rb', line 56 def self.reconcile_stale!(before: Clock.now - (timeout || 300)) store.find_stale_turns(before: before).each do |turn| store.update_turn(turn.fetch("id"), "status" => "stale", "completed_at" => Clock.now) end end |