Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Response validation failed" #23

Open
KernelDeimos opened this issue Aug 23, 2024 · 2 comments
Open

Getting "Response validation failed" #23

KernelDeimos opened this issue Aug 23, 2024 · 2 comments

Comments

@KernelDeimos
Copy link

I'm trying to use the typescript client and I am getting the following error message:

SDKValidationError: Response validation failed: [
  {
    "code": "invalid_type",
    "expected": "boolean",
    "received": "undefined",
    "path": [
      "choices",
      0,
      "message",
      "prefix"
    ],
    "message": "Required"
  }
]

This appears to be because the API is not responding with a boolean value for the prefix parameter. I noticed the error object conveniently has a rawValue property containing the response, so I checked that and it looks like I'm getting a successful response from the API (just missing that property):

{
  "id": "368ace4bd8b74009b22b9f96881d477e",
  "object": "chat.completion",
  "created": 1724380968,
  "model": "mistral-large-latest",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "-- actual text removed because it was long --",
        "tool_calls": null
      },
      "finish_reason": "stop",
      "logprobs": null
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "total_tokens": 663,
    "completion_tokens": 651
  }
}
@GaspardBT
Copy link
Collaborator

Hey, thanks, for reporting this
Could you share with us the following:

  • the version of the package you are running
  • the code snippet you're using
    To help us reproduce 🙇

@GaspardBT
Copy link
Collaborator

Hey,
#24 should have fix the issue, let us know if you still encounter the issue with the new version 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants