Module
agent
Module agent
nadheeshjihan/agent
0.1.8
Classes
agent: Agent
Agent implementation to perform tools with LLMs to add computational power and knowledge to the LLMs
Constructor
Initialize an Agent
init (LLMModel model, (BaseToolKit|Tool)... tools)
- model LLMModel - LLM model instance
- tools (BaseToolKit|Tool)... -
run
Execute the agent for a given user's query
Parameters
- query string - Natural langauge commands to the agent
- maxIter int (default 5) - No. of max iterations that agent will run to execute the task
Return Type
- error? - Returns error, in case of a failure
agent: ChatGPTModel
complete
Method included from *LLMModel
Fields
- Fields Included from *LLMModel
- llmClient LLMRemoteClient
- modelConfig ModelConfig
agent: GPT3Model
complete
Method included from *LLMModel
Fields
- Fields Included from *LLMModel
- llmClient LLMRemoteClient
- modelConfig ModelConfig
agent: HttpToolKit
initializeToolKit
function initializeToolKit(ToolStore store) returns ()
Method included from *BaseToolKit
Fields
- Fields Included from *BaseToolKit
- toolStore ToolStore
agent: OpenAPIToolKit
initializeToolKit
function initializeToolKit(ToolStore store) returns ()
Method included from *BaseToolKit
Fields
- Fields Included from *BaseToolKit
- toolStore ToolStore
Enums
agent: HttpMethod
Members
GET
POST
DELETE
Records
agent: ChatGPTModelConfig
Closed record
Fields
- Fields Included from *CreateChatCompletionRequest
- model string(default GPT3_5_MODEL_NAME) -
- temperature decimal?(default DEFAULT_TEMPERATURE) -
- messages ChatCompletionRequestMessage[](default []) -
agent: generatedOutput
Closed record
Fields
- toolNames string -
- toolDescriptions string -
agent: GPT3ModelConfig
Closed record
Fields
- Fields Included from *CreateCompletionRequest
- model string
- prompt string|string[]|int[]|PromptItemsArray[]|()
- suffix string|()
- max_tokens int|()
- temperature decimal|()
- top_p decimal|()
- n int|()
- stream boolean|()
- logprobs int|()
- echo boolean|()
- stop string|string[]|()
- presence_penalty decimal|()
- frequency_penalty decimal|()
- best_of int|()
- logit_bias record { anydata... }
- user string
- anydata...
- model string(default GPT3_MODEL_NAME) -
- temperature decimal?(default DEFAULT_TEMPERATURE) -
- max_tokens int?(default COMPLETION_TOKEN_MIN_LIMIT) -
agent: Headers
Fields
agent: HttpTool
Closed record
Fields
- name string -
- description string -
- path string -
- method HttpMethod -
- queryParams Parameters(default {}) -
- requestBody json(default {}) -
agent: InputSchema
agent: LLMResponse
Closed record
Parsed response from the LLM
Fields
- tool string - Name of the tool to be performed
- toolInput json - Input to the tool
- thought string - Thought by the LLM
- finalThought boolean - If the thought is the final one
agent: Parameters
Fields
agent: Tool
Closed record
Fields
- name string -
- description string -
- inputs InputSchema?(default ()) -
- caller
function() ()
-
Object types
agent: BaseToolKit
Distinct
agent: LLMModel
Distinct
Extendable LLM model object that can be used for completion tasks Useful to initialize the agents
Union types
agent: ModelConfig
ModelConfig
Import
import nadheeshjihan/agent;
Metadata
Released date: over 1 year ago
Version: 0.1.8
Compatibility
Platform: any
Ballerina version: 2201.5.0
GraalVM compatible: Yes
Pull count
Total: 66
Current verison: 1
Weekly downloads