Skip to Content

agent

Module: vibex/agent

Agent - Config-driven agent implementation

Agents are defined entirely by configuration, not code. Each agent is instantiated from a config object that defines its role, tools, and LLM settings.

Classes

Agent

View source

Config-driven Agent implementation No subclasses needed - behavior is entirely config-driven

Properties:

NameTypeDescription
idstring
namestring
descriptionstring
configAgentConfig
providerstring
modelstring
temperaturenumber
maxOutputTokensnumber
topPnumber
frequencyPenaltynumber
presencePenaltynumber
systemPromptstring
toolsstring[]
personalitystring

Methods:

getModel

View source

Get the model provider for this agent

function getModel(context?: { spaceId?: string; userId?: string; }): LanguageModel

Parameters:

NameTypeDescription
context\{ spaceId?: string; userId?: string; \} (optional)

prepareDebugInfo

View source

Prepare debug info without actually calling streamText Returns all the parameters that would be sent to the LLM

function prepareDebugInfo(options: { messages: XMessage[]; system?: string; spaceId?: string; metadata?: Record<string, any>; }): Promise<{ systemPrompt: string; tools: any; model: any; agentInfo: any; messages: any[]; }>

Parameters:

NameTypeDescription
optionsobject

streamText

View source

Stream text - works with XMessage[] internally Converts to ModelMessage[] only when calling AI SDK

function streamText(options: { messages: XMessage[]; system?: string; spaceId?: string; metadata?: Record<string, any>; [key: string]: any; // Allow all other AI SDK options to pass through }): Promise<any>

Parameters:

NameTypeDescription
optionsobject

generateText

View source

Generate text - works with XMessage[] internally Converts to ModelMessage[] only when calling AI SDK

function generateText(options: { messages: XMessage[]; system?: string; spaceId?: string; metadata?: Record<string, any>; [key: string]: any; }): Promise<any>

Parameters:

NameTypeDescription
optionsobject

getSummary

View source

Get agent summary

function getSummary(): Record<string, any>


Interfaces

AgentContext

View source

Properties:

NameTypeDescription
spaceIdstring
taskIdstring(optional)
conversationHistoryConversationHistory
metadataRecord<string, any>(optional)

AgentResponse

View source

Properties:

NameTypeDescription
textstring
toolCallsany[](optional)
reasoningTextstring(optional)
metadataRecord<string, any>(optional)