GithubHelp home page GithubHelp logo

Comments (2)

jleinenbach avatar jleinenbach commented on September 25, 2024

This is what ChatGPT 4 tells you about this error:

The error message you provided indicates several key issues related to how the API expects data to be structured and how it's being provided in the request. Let’s break down the primary issues as identified in the exception messages:

1. **Role Field Mismatch**: The `'role'` in the JSON payload is set to `'assistant'` when the expected roles seem to be `'system'`, `'user'`, `'tool'`, and `'function'` in various contexts. The role needs to be corrected based on the expected usage within the API.

2. **Missing Content Field**: There is a consistent issue with a missing `'content'` field in parts of your payload. This suggests that the structure of the data being passed is incomplete according to the API's requirements.

3. **Missing Tool Call ID and Name**: The exceptions also point out that the `'tool_call_id'` and `'name'` fields are missing in some parts of your JSON. These fields are likely necessary for the API to correctly process the request.

The overall error stems from the discrepancies between what your request includes (or omits) and what the API expects. The `"POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error` status code further implies that these validation errors are leading to a failure in processing the request.

from extended_openai_conversation.

billstei avatar billstei commented on September 25, 2024

After doing some testing using OpenAI's example code "Example invoking multiple function calls in one response" from here: https://platform.openai.com/docs/guides/function-calling I have concluded that this bug is not in Extended OpenAI Conversation integration, because the example code, running completely independently of HA or this integration, has the same problem (after modifying it to use llama_cpp.server, as above). Referring to that example code, a workaround was to change the "role": "tool", (line 70) to "role": "assistant", but that is not a real fix, just an observation for debugging. The problem seems to be in openai/_base_client.py

Closing this issue #203

from extended_openai_conversation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.