UNPKG

contentful-management

Version:
51 lines (50 loc) 1.48 kB
import type { DefaultElements, MakeRequest, MetaSysProps } from '../common-types'; import { type AgentGenerateResponse } from './agent-run'; export type AgentToolLink = { sys: { type: 'Link'; linkType: 'AgentTool'; id: string; }; }; export type AgentProps = { sys: MetaSysProps & { type: 'Agent'; space: { sys: { id: string; }; }; environment: { sys: { id: string; }; }; createdAt: string; id: string; }; name: string; description: string; tools?: Array<AgentToolLink>; provider?: string; modelId?: string; }; type AgentMessageRole = 'system' | 'user' | 'assistant' | 'tool'; export type AgentGeneratePayload<TMetadata = Record<string, unknown>> = { messages: Array<{ parts: Array<{ type: 'text'; text: string; }>; id?: string; role: AgentMessageRole; }>; threadId?: string; metadata?: TMetadata; }; export interface Agent extends AgentProps, DefaultElements<AgentProps> { generate(payload: AgentGeneratePayload): Promise<AgentGenerateResponse>; } export declare function wrapAgent(makeRequest: MakeRequest, data: AgentProps): Agent; export declare const wrapAgentCollection: (makeRequest: MakeRequest, data: import("..").CollectionProp<AgentProps>) => import("..").Collection<Agent, AgentProps>; export {};