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

Feature: Atomize string keys in stream responses #55

Open
APB9785 opened this issue Sep 20, 2023 · 0 comments
Open

Feature: Atomize string keys in stream responses #55

APB9785 opened this issue Sep 20, 2023 · 0 comments

Comments

@APB9785
Copy link

APB9785 commented Sep 20, 2023

Describe the feature or improvement you're requesting

Currently when stream: true is set, we're receiving responses with string keys:

%{
  "choices" => [
    %{"delta" => %{"role" => "assistant"}, "finish_reason" => nil, "index" => 0}
  ],
  "created" => 1682700668,
  "id" => "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a",
  "model" => "gpt-3.5-turbo-0301",
  "object" => "chat.completion.chunk"
}

In line with the standard (non-stream) responses, I'd expect this map to use atom keys i.e.

%{
  choices: [
    %{delta: %{role: "assistant"}, finish_reason: nil, index: 0}
  ],
  created: 1682700668,
  id: "chatcmpl-7ALbIuLju70hXy3jPa3o5VVlrxR6a",
  model: "gpt-3.5-turbo-0301",
  object: "chat.completion.chunk"
}

Additional context

No response

@APB9785 APB9785 changed the title Atomize string keys in stream responses Feature: Atomize string keys in stream responses Sep 20, 2023
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

1 participant