diff --git a/packages/agent/src/activities/agent.ts b/packages/agent/src/activities/agent.ts index d95f3ceb..eb3bb829 100644 --- a/packages/agent/src/activities/agent.ts +++ b/packages/agent/src/activities/agent.ts @@ -96,7 +96,7 @@ shumai has its own cloud file system. If a user asks you to perform file system If you need to create files in the local filesystem (for example, a temporary file for uploading), only the '.pi' folder in the current directory has write permissions. Do NOT attempt to create files in any other directories. -When creating a file or version, first use 'list_autofill_fields' to inspect the project's AI-autofillable metadata fields. If relevant metadata depends on information unavailable from the file content (for example, the AI model or tool used to generate it), include a brief context hint (maximum 50 words) in the 'context' field of 'create_file' or 'create_version' tool.` +When creating a file or version, first use 'list_autofill_fields' to inspect the project's AI-autofillable metadata fields. If relevant metadata depends on information unavailable from the file content (for example, the AI model or prompt used to generate the asset), include a context in the 'context' field of 'create_file' or 'create_version'. Keep the context short and only include information relevant to those fields.` if (agent.soul) { systemPrompt = `${systemPrompt}\n\nAgent Personality and Core Instructions:\n${agent.soul}` diff --git a/packages/agent/src/tools/create-file.ts b/packages/agent/src/tools/create-file.ts index 1ce5ae91..9ce92737 100644 --- a/packages/agent/src/tools/create-file.ts +++ b/packages/agent/src/tools/create-file.ts @@ -33,9 +33,10 @@ const createFileSchema = Type.Object({ context: Type.Optional( Type.String({ description: - 'Optional short context about this file and how it was generated (max 50 words, e.g. "Generated using gemini"). ' + - 'Passed to the AI metadata autofill workflow to fill fields that cannot be determined from file content alone. ' + - 'Check autofillable fields with list_autofill_fields first.', + 'Optional context passed to the AI metadata autofill workflow for fields that cannot be inferred from file content alone ' + + '(e.g. the model or prompt used to generate the asset). ' + + 'Use list_autofill_fields first to check which fields can be autofilled. ' + + 'Keep the context short and only include information relevant to those fields.', }), ), }) diff --git a/packages/agent/src/tools/create-version.ts b/packages/agent/src/tools/create-version.ts index 9a79c265..ffc287ae 100644 --- a/packages/agent/src/tools/create-version.ts +++ b/packages/agent/src/tools/create-version.ts @@ -20,9 +20,10 @@ const createVersionSchema = Type.Object({ context: Type.Optional( Type.String({ description: - 'Optional short context about this version and how it was generated (max 50 words, e.g. "Generated using gemini"). ' + - 'Passed to the AI metadata autofill workflow to fill fields that cannot be determined from file content alone. ' + - 'Check autofillable fields with list_autofill_fields first.', + 'Optional context passed to the AI metadata autofill workflow for fields that cannot be inferred from file content alone ' + + '(e.g. the model or prompt used to generate the asset). ' + + 'Use list_autofill_fields first to check which fields can be autofilled. ' + + 'Keep the context short and only include information relevant to those fields.', }), ), }) diff --git a/packages/agent/src/tools/list-autofill-fields.ts b/packages/agent/src/tools/list-autofill-fields.ts index 049da790..fc722d59 100644 --- a/packages/agent/src/tools/list-autofill-fields.ts +++ b/packages/agent/src/tools/list-autofill-fields.ts @@ -17,7 +17,7 @@ export function createListAutofillFieldsTool( label: 'List Autofill Fields', description: 'List the AI-autofillable metadata fields defined for the project of a parent folder, including their types and available options. ' + - 'Use this before creating a file or version so you can pass relevant context (e.g. generation source) to create_file/create_version.', + 'Use this before creating a file or version so you can pass relevant context (e.g. the model or prompt used to generate the asset) to create_file/create_version.', parameters: listAutofillFieldsSchema, execute: async (_toolCallId, params) => { const result = await executeAgentToolWorkflow({