diff --git a/agent/src/agent.ts b/agent/src/agent.ts index e90b5878..21d94877 100644 --- a/agent/src/agent.ts +++ b/agent/src/agent.ts @@ -25,7 +25,7 @@ export const createAgent = ({ }: AgentParams, fetch: AuthFetcher) => { const model = createModel(modelConfig) - const generateSystemPrompt = (attachmentPaths: string[] = []) => { + const generateSystemPrompt = () => { return system({ date: new Date(), language, @@ -33,7 +33,6 @@ export const createAgent = ({ channels, skills: [], enabledSkills: [], - attachments: attachmentPaths, }) } @@ -44,12 +43,6 @@ export const createAgent = ({ identity, }) - const getInputAttachmentPaths = (input: AgentInput): string[] => { - return input.attachments - .filter((a): a is ContainerFileAttachment => a.type === 'file') - .map(a => a.path) - } - const generateUserPrompt = (input: AgentInput) => { const images = input.attachments.filter(attachment => attachment.type === 'image') const files = input.attachments.filter((a): a is ContainerFileAttachment => a.type === 'file') @@ -73,8 +66,7 @@ export const createAgent = ({ const ask = async (input: AgentInput) => { const userPrompt = generateUserPrompt(input) const messages = [...input.messages, userPrompt] - const attachmentPaths = getInputAttachmentPaths(input) - const systemPrompt = generateSystemPrompt(attachmentPaths) + const systemPrompt = generateSystemPrompt() const { response, reasoning, text, usage } = await generateText({ model, messages, @@ -167,8 +159,7 @@ export const createAgent = ({ async function* stream(input: AgentInput): AsyncGenerator { const userPrompt = generateUserPrompt(input) const messages = [...input.messages, userPrompt] - const attachmentPaths = getInputAttachmentPaths(input) - const systemPrompt = generateSystemPrompt(attachmentPaths) + const systemPrompt = generateSystemPrompt() const attachmentsExtractor = new AttachmentsStreamExtractor() const result: { messages: ModelMessage[] diff --git a/agent/src/prompts/system.ts b/agent/src/prompts/system.ts index 2bc6bcc2..75e77606 100644 --- a/agent/src/prompts/system.ts +++ b/agent/src/prompts/system.ts @@ -27,7 +27,6 @@ export const system = ({ channels, skills, enabledSkills, - attachments = [], }: SystemParams) => { const headers = { 'language': language, @@ -36,27 +35,6 @@ export const system = ({ 'time-now': date.toISOString(), } - const attachmentPaths = attachments - .map((p) => (typeof p === 'string' ? p.trim() : '')) - .filter(Boolean) - - const attachmentsBlock = attachmentPaths.length - ? [ - '## Current Attachments', - '', - 'The following file paths are available in this request:', - '', - block( - [ - '', - ...attachmentPaths.map((p) => `- ${p}`), - '', - ].join('\n') - ), - '', - ].join('\n') - : '' - return ` --- ${Bun.YAML.stringify(headers)} @@ -111,6 +89,5 @@ ${skills.map(skill => `- ${skill.name}: ${skill.description}`).join('\n')} ${enabledSkills.map(skill => skillPrompt(skill)).join('\n\n---\n\n')} -${attachmentsBlock} `.trim() }