Class: PredictabilityEngine::Agents::Assistant
- Inherits:
-
Object
- Object
- PredictabilityEngine::Agents::Assistant
- Defined in:
- lib/predictability_engine/agents/assistant.rb
Instance Attribute Summary collapse
-
#assistant ⇒ Object
readonly
Returns the value of attribute assistant.
-
#llm ⇒ Object
readonly
Returns the value of attribute llm.
-
#tools ⇒ Object
readonly
Returns the value of attribute tools.
Instance Method Summary collapse
- #ask(question) ⇒ Object
-
#initialize(data_manager) ⇒ Assistant
constructor
A new instance of Assistant.
Constructor Details
#initialize(data_manager) ⇒ Assistant
Returns a new instance of Assistant.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/predictability_engine/agents/assistant.rb', line 8 def initialize(data_manager) # Using OpenAI as default. Requires OPENAI_API_KEY in .env @llm = Langchain::LLM::OpenAI.new(api_key: ENV.fetch('OPENAI_API_KEY', nil)) @tools = [PredictabilityEngine::Agents::Tools.new(data_manager)] @assistant = Langchain::Assistant.new( llm: @llm, tools: @tools, instructions: "You are an expert in Actionable Agile Metrics and Daniel Vacanti's predictability methods. Your job is to answer 'When will it be done?' questions based on historical data. Always explain the statistical confidence (p85) to the user. You can also analyze Cumulative Flow Diagrams for anomalies like growing WIP." ) end |
Instance Attribute Details
#assistant ⇒ Object (readonly)
Returns the value of attribute assistant.
6 7 8 |
# File 'lib/predictability_engine/agents/assistant.rb', line 6 def assistant @assistant end |
#llm ⇒ Object (readonly)
Returns the value of attribute llm.
6 7 8 |
# File 'lib/predictability_engine/agents/assistant.rb', line 6 def llm @llm end |
#tools ⇒ Object (readonly)
Returns the value of attribute tools.
6 7 8 |
# File 'lib/predictability_engine/agents/assistant.rb', line 6 def tools @tools end |
Instance Method Details
#ask(question) ⇒ Object
23 24 25 26 |
# File 'lib/predictability_engine/agents/assistant.rb', line 23 def ask(question) @assistant.(question) @assistant.run end |