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 sourceConfig-driven Agent implementation No subclasses needed - behavior is entirely config-driven
Properties:
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
description | string | |
config | AgentConfig | |
provider | string | |
model | string | |
temperature | number | |
maxOutputTokens | number | |
topP | number | |
frequencyPenalty | number | |
presencePenalty | number | |
systemPrompt | string | |
tools | string[] | |
personality | string |
Methods:
getModel
View sourceGet the model provider for this agent
function getModel(context?: {
spaceId?: string;
userId?: string;
}): LanguageModelParameters:
| Name | Type | Description |
|---|---|---|
context | \{ spaceId?: string; userId?: string; \} (optional) |
prepareDebugInfo
View sourcePrepare 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:
| Name | Type | Description |
|---|---|---|
options | object |
streamText
View sourceStream 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:
| Name | Type | Description |
|---|---|---|
options | object |
generateText
View sourceGenerate 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:
| Name | Type | Description |
|---|---|---|
options | object |
getSummary
View sourceGet agent summary
function getSummary(): Record<string, any>Interfaces
AgentContext
View sourceProperties:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
taskId | string | (optional) |
conversationHistory | ConversationHistory | |
metadata | Record<string, any> | (optional) |
AgentResponse
View sourceProperties:
| Name | Type | Description |
|---|---|---|
text | string | |
toolCalls | any[] | (optional) |
reasoningText | string | (optional) |
metadata | Record<string, any> | (optional) |