Skip to content

Conversation

@mweidner037
Copy link
Contributor

We're encountering these while using ChatGoogleAI but with original: nil. The PR adds original in that case, as well as in the other Chat... classes at an analogous place.

Note: There is a difference in the error messages returned in the "Unexpected response" case for streaming vs non-streaming, consistently across chat models. If you like, I can make them consistent with each other, in either direction.

# do_api_request(...{stream: false}...):
      other ->
        Logger.error("Unexpected and unhandled API response! #{inspect(other)}")
        other

# do_api_request(...{stream: true}...):
      other ->
        Logger.error(
          "Unhandled and unexpected response from streamed post call. #{inspect(other)}"
        )

        {:error,
         LangChainError.exception(
           type: "unexpected_response",
           message: "Unexpected response",
           original: other
         )}

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

Successfully merging this pull request may close these issues.

1 participant