apexive / apexive/odoo-llm

Invalid shcema with agents

未关闭
#212 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
219
派生
159
PR 合并指标
30 天内没有已合并 PR

描述

I am getting an issue when I use one tool odoo_model_inspector
It makes the API request fails:

Image

Letta.agent-1f4f2a40-cd27-4a34-b784-31de0568ca74 - WARNING - Context token estimate is not set
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='odoo_record_creator', description='Create one or multiple new records in any Odoo model. This tool allows you to insert data into the database by specifying the model name and either:\n- A dictionary of field values using the "fields" parameter for a single record, OR\n- A list of dictionaries using the "records" parameter for multiple records at once.\n\nExamples:\n1. Single record: {"model": "res.partner", "fields": {"name": "John Doe", "email": "john@example.com"}}\n2. Multiple records: {"model": "res.partner", "records": [{"name": "John Doe", "email": "john@example.com"}, {"name": "Jane Smith", "email": "jane@example.com"}]}\n\nDue to its data modification capabilities, this tool requires user consent before execution.', parameters={'properties': {'model': {'title': 'Model', 'type': 'string'}, 'fields': {'additionalProperties': True, 'default': None, 'title': 'Fields', 'type': 'object'}, 'records': {'default': None, 'items': {'additionalProperties': True, 'type': 'object'}, 'title': 'Records', 'type': 'array'}}, 'required': ['model'], 'title': 'odoo_record_creator_executeArguments', 'type': 'object', 'additionalProperties': False}, strict=False), error=Property {'additionalProperties': True, 'default': None, 'title': 'Fields', 'type': 'object'} of type object is missing properties
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='odoo_model_method_executor', description="\n**VERY HIGH RISK TOOL:** Executes a specified method on an Odoo model or specific records. Provide the model's technical name, the method name, and optionally a list of record IDs, positional arguments ('args'), and keyword arguments ('kwargs'). If record_ids is null/empty, the method is called on the model itself (e.g., for `search`, `create`, `@api.model`, `@staticmethod`).\n**WARNING:** This tool can modify or delete data, trigger complex actions, or cause system errors if used improperly. It bypasses standard UI workflows.\n**IMPORTANT:** The LLM using this tool MUST explicitly ask the user for confirmation before EVERY execution, clearly stating the model, method, records (if any), and arguments being used.\nPrivate methods (starting with '_') are disallowed by default unless 'allow_private' is explicitly set to true (use with extreme caution).\nReturns a JSON representation of the method's result or an error message.\n ", parameters={'properties': {'model': {'title': 'Model', 'type': 'string'}, 'method': {'title': 'Method', 'type': 'string'}, 'record_ids': {'anyOf': [{'items': {'type': 'integer'}, 'type': 'array'}, {'type': 'null'}], 'default': None, 'title': 'Record Ids'}, 'args': {'anyOf': [{'items': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'null'}]}, 'type': 'array'}, {'type': 'null'}], 'default': None, 'title': 'Args'}, 'kwargs': {'anyOf': [{'additionalProperties': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'null'}]}, 'type': 'object'}, {'type': 'null'}], 'default': None, 'title': 'Kwargs'}, 'allow_private': {'default': False, 'title': 'Allow Private', 'type': 'boolean'}}, 'required': ['model', 'method'], 'title': 'odoo_model_method_executor_executeArguments', 'type': 'object', 'additionalProperties': False}, strict=False), error=Property {'additionalProperties': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'null'}]}, 'type': 'object'} of type object is missing properties
Letta.letta.llm_api.openai_client - WARNING - Failed to convert tool function to structured output, tool=type='function' function=FunctionSchema(name='odoo_record_updater', description='Update existing records in any Odoo model. This tool allows you to modify data in the database by specifying the model name, domain filters to identify records, and a dictionary of field values to update. For safety, it defaults to updating only one record at a time. Due to its data modification capabilities, this tool requires user consent before execution.', parameters={'properties': {'model': {'title': 'Model', 'type': 'string'}, 'domain': {'items': {'items': {'anyOf': [{'type': 'string'}, {'type': 'integer'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'null'}]}, 'type': 'array'}, 'title': 'Domain', 'type': 'array'}, 'values': {'additionalProperties': True, 'title': 'Values', 'type': 'object'}, 'limit': {'default': 1, 'title': 'Limit', 'type': 'integer'}}, 'required': ['model', 'domain', 'values'], 'title': 'odoo_record_updater_executeArguments', 'type': 'object', 'additionalProperties': False}, strict=False), error=Property {'additionalProperties': True, 'title': 'Values', 'type': 'object'} of type object is missing properties
httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 400 Bad Request"
Letta.letta.llm_api.openai_client - ERROR - Error streaming OpenAI Chat Completions request: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}} with request data: {"model": "gpt-4", "messages": [{"content": "You are an Assistant Creator Assistant.\n\nYour goal is to guide users through the complete process of creating and configuring specialized AI assistants in Odoo, ensuring all required fields are properly set, appropriate tools are attached, and the assistant's purpose is clearly defined with optimal prompting.\n\nBackground: Expert in the llm.assistant model structure and relationships with other LLM models in Odoo.\nFamiliar with best practices for designing effective AI assistants including role definition, goal setting, and instruction crafting.\nUnderstanding of the available tools and their appropriate use cases for different assistant types.\nKnowledge of system prompt templates and variable substitution patterns for creating effective assistant behaviors.\nCommitted to continuous self-improvement by learning from past assistant creation mistakes, tracking common errors, and refining approaches based on user feedback.\n\nInstructions: When helping users create a new llm.assistant:\n\n1. INSPECTION PHASE:\n - Use the odoo_model_inspector tool to examine the llm.assistant model structure\n - Use the odoo_fields_inspector tool to identify all required and optional fields\n - Use the odoo_record_retriever tool to find examples of existing assistants when needed\n\n2. PLANNING PHASE:\n - Help the user define a clear purpose for their assistant\n - Guide them in crafting an effective role, goal, and background\n - Create detailed, step-by-step instructions that clearly outline the assistant's workflow and decision-making process\n - Structure instructions with numbered steps, clear sections, and explicit guidance on how to handle different scenarios\n - Recommend appropriate tools based on the assistant's intended function:\n * Knowledge tools for information retrieval assistants\n * Odoo tools for record manipulation assistants\n * Web tools for internet-connected assistants\n - Always include technical context about relevant models and fields in the assistant's background and instructions if applicable.\n * Use odoo_model_inspector and odoo_fields_inspector to gather this technical information for required data only\n * Document field types, relationships, and constraints that are relevant to the assistant's function\n * Include information about model methods and business logic when applicable\n\n3. CREATION PHASE:\n - Use the odoo_record_creator tool to create the llm.assistant record with all required fields\n - Ensure the provider_id and model_id (these are ids of record) are available, you can use odoo_record_retriever to look for already available providers and models using ilike operator for best results.\n - Set appropriate tool_ids(llm.tool's ids), you can use odoo_record_retriever to look for already available tools(llm.tool) using ilike operator for best results.\n\n4. VALIDATION PHASE:\n - Verify the created assistant has all necessary components\n - Test the system_prompt with the defined variables\n - Ensure instructions are comprehensive, detailed, and provide clear guidance for all expected use cases\n - Suggest improvements to the assistant configuration\n - If applicable ensure the assistant has sufficient technical context about the models and fields it will work with\n - Recommend additional technical details if the assistant's domain knowledge seems incomplete\n\n5. CONTINUOUS IMPROVEMENT:\n - Include instructions for the assistant to learn from mistakes and adjust its behavior\n - Add specific guidance on how to identify errors or misunderstandings\n - Provide mechanisms for the assistant to correct itself when it makes mistakes\n - Encourage the assistant to seek feedback and improve based on user interactions\n - Document common pitfalls and how to avoid them in the assistant's instructions\n\nTOOL USAGE GUIDE:\n- odoo_model_inspector: For understanding model structure and relationships\n- odoo_fields_inspector: For identifying required and optional fields\n- odoo_record_retriever: For finding examples and references\n- odoo_record_creator: For creating new assistant records\n- odoo_record_updater: For modifying existing assistant records\n\nIMPORTANT TOOL USAGE RULES:\n- Before using any tool, always verify you're using the correct schema and parameter format\n- Check tool documentation to understand required and optional parameters\n- Ensure all parameter values are properly formatted (strings, integers, booleans, etc.)\n- Use proper data structures (lists, dictionaries) as required by each tool\n\nAvailable fields for llm.assistant model:\n- name: Name of the assistant\n- provider_id: LLM provider to use, related to llm.provider model (e.g., OpenAI)\n- model_id: Specific model to use, related to llm.model model (must be compatible with the provider)\n- prompt_id: Prompt template to use for generating system prompt\n- default_values: JSON with default values for prompt variables\n- tool_ids: Tools that the assistant can use, related to llm.tool model\n\nIMPORTANT: Learn from your own mistakes during the assistant creation process. When errors occur or users provide feedback, document these issues and adjust your approach accordingly. Continuously improve your guidance by tracking what works well and what doesn't. Apply these lessons to future assistant creation tasks to provide increasingly effective assistance.\n\n\nThe following memory blocks are currently engaged in your core memory unit:\n\n\n\nThe persona block: Stores details about your current persona, guiding how you behave and respond. This helps you to maintain consistency and personality in your interactions.\n\n\n- chars_current=28\n- chars_limit=20000\n\n\nI am a helpful AI assistant.\n\n\n\n\n\nThe human block: Stores key details about the person you are conversing with, allowing for more personalized and friend-like conversation.\n\n\n- chars_current=35\n- chars_limit=20000\n\n\nThe human's name is Mitchell Admin.\n\n\n\n\n\n\n- The current system date is: December 15, 2025\n- Memory blocks were last modified: 2025-12-15 10:10:40 PM UTC+0000\n- 0 previous messages between you and the user are stored in recall memory (use tools to access them)\n", "role": "system"}, {"content": "Hi GPT", "role": "user"}], "max_completion_tokens": null, "temperature": 0.7, "user": "user-00000000-0000-4000-8000-000000000000", "parallel_tool_calls": false, "tools": [{"type": "function", "function": {"name": "conversation_search", "description": "Search prior conversation history using hybrid search (text + semantic similarity).\n\nExamples:\n # Search all messages\n conversation_search(query=\"project updates\")\n\n # Search only assistant messages\n conversation_search(query=\"error handling\", roles=[\"assistant\"])\n\n # Search with date range (inclusive of both dates)\n conversation_search(query=\"meetings\", start_date=\"2024-01-15\", end_date=\"2024-01-20\")\n # This includes all messages from Jan 15 00:00:00 through Jan 20 23:59:59\n\n # Search messages from a specific day (inclusive)\n conversation_search(query=\"bug reports\", start_date=\"2024-09-04\", end_date=\"2024-09-04\")\n # This includes ALL messages from September 4, 2024\n\n # Search with specific time boundaries\n conversation_search(query=\"deployment\", start_date=\"2024-01-15T09:00\", end_date=\"2024-01-15T17:30\")\n # This includes messages from 9 AM to 5:30 PM on Jan 15\n\n # Search with limit\n conversation_search(query=\"debugging\", limit=10)\n\n Returns:\n str: Query result string containing matching messages with timestamps and content.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "String to search for using both text matching and semantic similarity."}, "roles": {"type": "array", "items": {"type": "string", "enum": ["assistant", "user", "tool"]}, "description": "Optional list of message roles to filter by."}, "limit": {"type": "integer", "description": "Maximum number of results to return. Uses system default if not specified."}, "start_date": {"type": "string", "description": "Filter results to messages created on or after this date (INCLUSIVE). When using date-only format (e.g., \"2024-01-15\"), includes messages starting from 00:00:00 of that day. ISO 8601 format: \"YYYY-MM-DD\" or \"YYYY-MM-DDTHH:MM\". Examples: \"2024-01-15\" (from start of Jan 15), \"2024-01-15T14:30\" (from 2:30 PM on Jan 15)."}, "end_date": {"type": "string", "description": "Filter results to messages created on or before this date (INCLUSIVE). When using date-only format (e.g., \"2024-01-20\"), includes all messages from that entire day. ISO 8601 format: \"YYYY-MM-DD\" or \"YYYY-MM-DDTHH:MM\". Examples: \"2024-01-20\" (includes all of Jan 20), \"2024-01-20T17:00\" (up to 5 PM on Jan 20)."}}, "additionalProperties": false, "required": ["query", "roles", "limit", "start_date", "end_date"]}, "strict": true}}, {"type": "function", "function": {"name": "memory_insert", "description": "The memory_insert command allows you to insert text at a specific location in a memory block.\n\nExamples:\n # Update a block containing information about the user (append to the end of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\")\n\n # Update a block containing information about the user (insert at the beginning of the block)\n memory_insert(label=\"customer\", new_str=\"The customer's ticket number is 12345\", insert_line=0)\n\n Returns:\n Optional[str]: None is always returned as this function does not produce a response.", "parameters": {"type": "object", "properties": {"label": {"type": "string", "description": "Section of the memory to be edited, identified by its label."}, "new_str": {"type": "string", "description": "The text to insert. Do not include line number prefixes."}, "insert_line": {"type": "integer", "description": "The line number after which to insert the text (0 for beginning of file). Defaults to -1 (end of the file)."}}, "additionalProperties": false, "required": ["label", "new_str", "insert_line"]}, "strict": true}}, {"type": "function", "function": {"name": "memory_replace", "description": "The memory_replace command allows you to replace a specific string in a memory block with a new string. This is used for making precise edits.\n\nDo NOT attempt to replace long strings, e.g. do not attempt to replace the entire contents of a memory block with a new string.\n\nExamples:\n # Update a block containing information about the user\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n # Update a block containing a todo list\n memory_replace(label=\"todos\", old_str=\"- [ ] Step 5: Search the web\", new_str=\"- [x] Step 5: Search the web\")\n\n # Pass an empty string to\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"\")\n\n # Bad example - do NOT add (view-only) line numbers to the args\n memory_replace(label=\"human\", old_str=\"1: Their name is Alice\", new_str=\"1: Their name is Bob\")\n\n # Bad example - do NOT include the line number warning either\n memory_replace(label=\"human\", old_str=\"# NOTE: Line numbers shown below (with arrows like '1\u2192') are to help during editing. Do NOT include line number prefixes in your memory edit tool calls.\\n1\u2192 Their name is Alice\", new_str=\"1\u2192 Their name is Bob\")\n\n # Good example - no line numbers or line number warning (they are view-only), just the text\n memory_replace(label=\"human\", old_str=\"Their name is Alice\", new_str=\"Their name is Bob\")\n\n Returns:\n str: The success message", "parameters": {"type": "object", "properties": {"label": {"type": "string", "description": "Section of the memory to be edited, identified by its label."}, "old_str": {"type": "string", "description": "The text to replace (must match exactly, including whitespace and indentation)."}, "new_str": {"type": "string", "description": "The new text to insert in place of the old text. Do not include line number prefixes."}}, "additionalProperties": false, "required": ["label", "old_str", "new_str"]}, "strict": true}}, {"type": "function", "function": {"name": "odoo_record_creator", "description": "Create one or multiple new records in any Odoo model. This tool allows you to insert data into the database by specifying the model name and either:\n- A dictionary of field values using the \"fields\" parameter for a single record, OR\n- A list of dictionaries using the \"records\" parameter for multiple records at once.\n\nExamples:\n1. Single record: {\"model\": \"res.partner\", \"fields\": {\"name\": \"John Doe\", \"email\": \"john@example.com\"}}\n2. Multiple records: {\"model\": \"res.partner\", \"records\": [{\"name\": \"John Doe\", \"email\": \"john@example.com\"}, {\"name\": \"Jane Smith\", \"email\": \"jane@example.com\"}]}\n\nDue to its data modification capabilities, this tool requires user consent before execution.", "parameters": {"properties": {"model": {"title": "Model", "type": "string"}, "fields": {"additionalProperties": true, "default": null, "title": "Fields", "type": "object"}, "records": {"default": null, "items": {"additionalProperties": true, "type": "object"}, "title": "Records", "type": "array"}}, "required": ["model"], "title": "odoo_record_creator_executeArguments", "type": "object", "additionalProperties": false}}}, {"type": "function", "function": {"name": "odoo_model_inspector", "description": "\n Comprehensive inspection of an Odoo model providing a complete analysis of its structure. This tool retrieves detailed information about:\n\n 1. **Basic Model Data**: Name, description, module, and inheritance structure.\n 2. **Fields Analysis**: Types, properties, relations, required/readonly status, and help text.\n 3. **Methods Inspection**: Signatures, docstrings, decorators (@api.model, @api.depends, etc.), and method types.\n\n Use this tool to understand any Odoo model's structure, fields, and available methods. You can filter fields and methods by name or type, limit the number returned, and include/exclude private elements (those starting with '_').\n\n This information is essential for:\n - Understanding available data structures\n - Determining which fields to use for record creation/updates\n - Finding appropriate methods to execute with the model_method_executor tool\n - Building domain filters for record retrieval\n\n Perfect for exploring unfamiliar models before performing operations on them.\n ", "parameters": {"type": "object", "properties": {"model": {"type": "string", "title": "Model"}, "include_fields": {"type": "boolean", "default": true, "title": "Include Fields"}, "include_methods": {"type": "boolean", "default": true, "title": "Include Methods"}, "field_limit": {"type": "integer", "default": 30, "title": "Field Limit"}, "method_limit": {"type": "integer", "default": 20, "title": "Method Limit"}, "include_private": {"type": "boolean", "default": false, "title": "Include Private"}, "method_name_filter": {"type": ["string", "null"], "default": null}, "method_type_filter": {"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "null"}], "default": null, "title": "Method Type Filter"}, "field_name_filter": {"type": ["string", "null"], "default": null}, "field_type_filter": {"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "null"}], "default": null, "title": "Field Type Filter"}}, "additionalProperties": false, "required": ["model", "include_fields", "include_methods", "field_limit", "method_limit", "include_private", "method_name_filter", "method_type_filter", "field_name_filter", "field_type_filter"]}, "strict": true}}, {"type": "function", "function": {"name": "odoo_record_retriever", "description": "Retrieve records from any Odoo model with filtering capabilities. This tool allows you to fetch data from the database by specifying the model name, domain filters, fields to retrieve, and a limit on the number of records returned.", "parameters": {"type": "object", "properties": {"model": {"type": "string", "title": "Model"}, "domain": {"type": "array", "items": {"type": "array", "items": {"type": ["string", "integer", "boolean", "number", "null"]}}, "title": "Domain"}, "fields": {"type": "array", "items": {"type": "string"}, "title": "Fields"}, "limit": {"type": "integer", "default": 100, "title": "Limit"}}, "additionalProperties": false, "required": ["model", "domain", "fields", "limit"]}, "strict": true}}, {"type": "function", "function": {"name": "odoo_model_method_executor", "description": "\n**VERY HIGH RISK TOOL:** Executes a specified method on an Odoo model or specific records. Provide the model's technical name, the method name, and optionally a list of record IDs, positional arguments ('args'), and keyword arguments ('kwargs'). If record_ids is null/empty, the method is called on the model itself (e.g., for `search`, `create`, `@api.model`, `@staticmethod`).\n**WARNING:** This tool can modify or delete data, trigger complex actions, or cause system errors if used improperly. It bypasses standard UI workflows.\n**IMPORTANT:** The LLM using this tool MUST explicitly ask the user for confirmation before EVERY execution, clearly stating the model, method, records (if any), and arguments being used.\nPrivate methods (starting with '_') are disallowed by default unless 'allow_private' is explicitly set to true (use with extreme caution).\nReturns a JSON representation of the method's result or an error message.\n ", "parameters": {"properties": {"model": {"title": "Model", "type": "string"}, "method": {"title": "Method", "type": "string"}, "record_ids": {"anyOf": [{"items": {"type": "integer"}, "type": "array"}, {"type": "null"}], "default": null, "title": "Record Ids"}, "args": {"anyOf": [{"items": {"anyOf": [{"type": "string"}, {"type": "integer"}, {"type": "boolean"}, {"type": "number"}, {"type": "null"}]}, "type": "array"}, {"type": "null"}], "default": null, "title": "Args"}, "kwargs": {"anyOf": [{"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "integer"}, {"type": "boolean"}, {"type": "number"}, {"type": "null"}]}, "type": "object"}, {"type": "null"}], "default": null, "title": "Kwargs"}, "allow_private": {"default": false, "title": "Allow Private", "type": "boolean"}}, "required": ["model", "method"], "title": "odoo_model_method_executor_executeArguments", "type": "object", "additionalProperties": false}}}, {"type": "function", "function": {"name": "odoo_record_updater", "description": "Update existing records in any Odoo model. This tool allows you to modify data in the database by specifying the model name, domain filters to identify records, and a dictionary of field values to update. For safety, it defaults to updating only one record at a time. Due to its data modification capabilities, this tool requires user consent before execution.", "parameters": {"properties": {"model": {"title": "Model", "type": "string"}, "domain": {"items": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}, {"type": "boolean"}, {"type": "number"}, {"type": "null"}]}, "type": "array"}, "title": "Domain", "type": "array"}, "values": {"additionalProperties": true, "title": "Values", "type": "object"}, "limit": {"default": 1, "title": "Limit", "type": "integer"}}, "required": ["model", "domain", "values"], "title": "odoo_record_updater_executeArguments", "type": "object", "additionalProperties": false}}}], "tool_choice": "auto"}
Letta.letta.llm_api.openai_client - WARNING - [OpenAI] Bad request (400): Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Letta.agent-1f4f2a40-cd27-4a34-b784-31de0568ca74 - WARNING - Error during step processing: INVALID_ARGUMENT: Bad request to OpenAI: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Letta.agent-1f4f2a40-cd27-4a34-b784-31de0568ca74 - INFO - Running final update. Step Progression: StepProgression.START
Letta.agent-1f4f2a40-cd27-4a34-b784-31de0568ca74 - WARNING - Error during agent stream: INVALID_ARGUMENT: Bad request to OpenAI: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Traceback (most recent call last):
File "/app/letta/adapters/simple_llm_stream_adapter.py", line 122, in invoke_llm
stream = await self.llm_client.stream_async(request_data, self.llm_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/otel/tracing.py", line 375, in async_wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/letta/llm_api/openai_client.py", line 792, in stream_async
raise e
File "/app/letta/llm_api/openai_client.py", line 785, in stream_async
response_stream: AsyncStream[ChatCompletionChunk] = await client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 2678, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/openai/_base_client.py", line 1794, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/openai/_base_client.py", line 1594, in request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/letta/agents/letta_agent_v3.py", line 300, in stream
async for chunk in response:
File "/app/letta/agents/letta_agent_v3.py", line 824, in _step
raise e
File "/app/letta/agents/letta_agent_v3.py", line 675, in _step
raise e
File "/app/letta/agents/letta_agent_v3.py", line 663, in _step
async for chunk in invocation:
File "/app/letta/adapters/simple_llm_stream_adapter.py", line 124, in invoke_llm
raise self.llm_client.handle_llm_error(e)
letta.errors.LLMBadRequestError: INVALID_ARGUMENT: Bad request to OpenAI: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}
Letta.letta.services.streaming_service - ERROR - Run run-11dbcd13-9288-4901-a793-968544a8dbce stopped with LLM error: INVALID_ARGUMENT: Bad request to OpenAI: Error code: 400 - {'error': {'message': "Invalid schema for function 'odoo_model_inspector': In context=('properties', 'method_name_filter'), schema must have a 'type' key.", 'type': 'invalid_request_error', 'param': None, 'code': None}}, error_data: {'message_type': 'error_message', 'run_id': 'run-11dbcd13-9288-4901-a793-968544a8dbce', 'error_type': 'llm_error', 'message': 'An error occurred with the LLM request.', 'detail': 'INVALID_ARGUMENT: Bad request to OpenAI: Error code: 400 - {\'error\': {\'message\': "Invalid schema for function \'odoo_model_inspector\': In context=(\'properties\', \'method_name_filter\'), schema must have a \'type\' key.", \'type\': \'invalid_request_error\', \'param\': None, \'code\': None}}'}
Letta.letta.services.run_manager - WARNING - Run run-11dbcd13-9288-4901-a793-968544a8dbce completed without a completed_at timestamp

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。