View Source Train.Agents.ConversationalChatAgent (train v0.0.1-dev)

Link to this section Summary

Functions

Calls the agent with the given question and tools. It returns :ok, the list of messages used in the OpenAI's api, and the response.

Creates the system prompt for the agent.

Link to this section Functions

Link to this function

call(chain, question, chat_history \\ [])

View Source
@spec call(Train.LlmChain.t(), String.t(), String.t()) ::
  {:ok, [String.t()], String.t()} | {:error, [String.t()], String.t()}

Calls the agent with the given question and tools. It returns :ok, the list of messages used in the OpenAI's api, and the response.

A previous conversation can be passed as the 3rd parameter (messages).

Link to this function

create_prompt(prompts, input, tools, chat_history \\ [])

View Source
@spec create_prompt(Train.Agents.PromptSpec.t(), String.t(), [Train.ToolSpec.t()], [
  String.t()
]) :: [
  String.t()
]

Creates the system prompt for the agent.