Skip to content

OpenAI missing JSON properties with streaming #208

@GregoireDaure

Description

@GregoireDaure

Describe the bug

Hi,

We are facing problems with OpenAiChatModel and streaming. We are getting errors about missing json properties i.e. finish_reason with a custom OpenAi endpoint.

BTW, we have no problem when streaming is off.

Steps to reproduce the bug

Create an OpenAiChatModel
Set streaming to true
Call GenerateAsync
An exception is raised for missing json properties

Expected behavior

Properties should not be required I guess.

Screenshots

Image

NuGet package version

LangChain.Providers.OpenAI => 0.17.1-dev.45
LangChain.Core => 0.17.1-dev.51

Additional context

Is there any reason to not use the official OpenAI sdk instead of the AutoSDK generated version ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions