Module
agent
nadheeshjihan/agent
0.1.2
Classes
agent: Agent
Agent implementation to perform actions with LLMs to add computational power and knowledge to the LLMs
Constructor
Initialize an Agent
init (LLMModel model, (ActionLoader|Action)... actions)
- model LLMModel - LLM model instance
- actions (ActionLoader|Action)... -
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: GPT3Model
complete
Method included from *LLMModel
Fields
- Fields Included from *LLMModel
- llmClient LLMRemoteClient
- config ClientConfig
- config GPT3Config -
agent: HttpLoader
initializeLoader
function initializeLoader(ActionStore store) returns ()
Method included from *ActionLoader
Fields
- Fields Included from *ActionLoader
- actionStore ActionStore
agent: OpenAPILoader
initializeLoader
function initializeLoader(ActionStore store) returns ()
Method included from *ActionLoader
Fields
- Fields Included from *ActionLoader
- actionStore ActionStore
Enums
agent: HttpMethod
Members
GET
POST
DELETE
Records
agent: Action
Closed record
Fields
- name string -
- description string -
- inputs InputSchema?(default ()) -
- caller
function() ()
-
agent: generatedOutput
Closed record
Fields
- actionNames string -
- actionDescriptions string -
agent: GPT3Config
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...
- temperature decimal?(default DEFAULT_TEMPERATURE) -
- max_tokens int?(default COMPLETION_TOKEN_MIN_LIMIT) -
agent: Headers
Fields
agent: HttpAction
Closed record
Fields
- name string -
- description string -
- path string -
- method HttpMethod -
- queryParams Parameters(default {}) -
- requestBody json(default {}) -
agent: InputSchema
agent: Json
Fields
agent: LLMResponse
Closed record
Parsed response from the LLM
Fields
- action string - Name of the action to be performed
- actionInput json - Input to the action
- thought string - Thought by the LLM
- finalThought boolean - If the thought is the final one
agent: Parameters
Fields
Object types
agent: ActionLoader
Distinct
agent: LLMModel
Distinct
Extendable LLM model object that can be used for completion tasks Useful to initialize the agents
Fields
- llmClient LLMRemoteClient - A remote client object to access LLM models
- config ClientConfig - Required client/model configs to use the client
Union types
agent: ClientConfig
ClientConfig
agent: LLMRemoteClient
LLMRemoteClient
Import
import nadheeshjihan/agent;
Metadata
Released date: over 1 year ago
Version: 0.1.2
Compatibility
Platform: any
Ballerina version: 2201.4.0
GraalVM compatible: Yes
Pull count
Total: 66
Current verison: 1
Weekly downloads