Module
agent
nadheeshjihan/agent
0.1.1
Functions![](/images/permalink.svg)
main![](/images/permalink.svg)
function main() returns error?
Classes![](/images/permalink.svg)
agent: Agent![](/images/permalink.svg)
Agent implementation to perform actions with LLMs to add computational power and knowledge to the LLMs
Constructor![](/images/permalink.svg)
Initialize an Agent
init (LLMModel model, (ActionLoader|Action)... actions)
- model LLMModel - LLM model instance
- actions (ActionLoader|Action)... -
run![](/images/permalink.svg)
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![](/images/permalink.svg)
complete![](/images/permalink.svg)
Method included from *LLMModel
Fields
- Fields Included from *LLMModel
- llmClient LLMRemoteClient
- config ClientConfig
- config GPT3Config -
agent: HttpLoader![](/images/permalink.svg)
initializeLoader![](/images/permalink.svg)
function initializeLoader(ActionStore store) returns ()
Method included from *ActionLoader
Fields
- Fields Included from *ActionLoader
- actionStore ActionStore
agent: OpenAPILoader![](/images/permalink.svg)
initializeLoader![](/images/permalink.svg)
function initializeLoader(ActionStore store) returns ()
Method included from *ActionLoader
Fields
- Fields Included from *ActionLoader
- actionStore ActionStore
Enums![](/images/permalink.svg)
agent: HttpMethod![](/images/permalink.svg)
Members
GET
POST
DELETE
Records![](/images/permalink.svg)
agent: Action![](/images/permalink.svg)
Closed record
Fields
- name string -
- description string -
- inputs InputSchema?(default ()) -
- caller
function() ()
-
agent: generatedOutput![](/images/permalink.svg)
Closed record
Fields
- actionNames string -
- actionDescriptions string -
agent: GPT3Config![](/images/permalink.svg)
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![](/images/permalink.svg)
Fields
agent: HttpAction![](/images/permalink.svg)
Closed record
Fields
- name string -
- description string -
- path string -
- method HttpMethod -
- queryParams Parameters(default {}) -
- requestBody json(default {}) -
agent: InputSchema![](/images/permalink.svg)
agent: Json![](/images/permalink.svg)
Fields
agent: LLMResponse![](/images/permalink.svg)
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![](/images/permalink.svg)
Fields
Object types![](/images/permalink.svg)
agent: ActionLoader![](/images/permalink.svg)
Distinct
agent: LLMModel![](/images/permalink.svg)
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![](/images/permalink.svg)
agent: ClientConfig![](/images/permalink.svg)
ClientConfig
agent: LLMRemoteClient![](/images/permalink.svg)
LLMRemoteClient
Import
import nadheeshjihan/agent;
Metadata
Released date: over 1 year ago
Version: 0.1.1
Compatibility
Platform: any
Ballerina version: 2201.4.0
GraalVM compatible: Yes
Pull count
Total: 66
Current verison: 1
Weekly downloads