Skip to content

Something err when stream is not true in requst body #63

@GuanJdoJ

Description

@GuanJdoJ

I run a local service according to this document.

It is OK when "stream": true is set in request body. But if you don't set the stream, it will fail.

Success:

curl --location 'http://localhost:8001/proxy/v1/chat/completions' \
--header 'Authorization: Bearer $BRAINTRUST_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-3.5-turbo",
    "messages": [
        {
            "role": "user",
            "content": "What is your model?"
        }
    ],
    "stream": true,
    "max_tokens": 150,
    "seed": 1
}'

Failed:

curl --location 'http://localhost:8001/proxy/v1/chat/completions' \
--header 'Authorization: $BRAINTRUST_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-3.5-turbo",
    "messages": [
        {
            "role": "user",
            "content": "What is your model?"
        }
    ],
    "max_tokens": 150,
    "seed": 1
}'

But call https://braintrustproxy.com will be OK. Why?

curl --location 'https://braintrustproxy.com/proxy/v1/chat/completions' \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "What is a proxy?"
      }
    ],
    "seed": 1
  }' \
  -H "Authorization: Bearer $OPENAI_API_KEY"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions