mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 21:35:08 +00:00
community: OCI Generative AI tool calling bug fix (#26910)
- [x] **PR title**: "community: OCI Generative AI tool calling bug fix - [x] **PR message**: - **Description:** bug fix for streaming chat responses with tool calls. Update to PR 24693 - **Issue:** chat response content is repeated when streaming - **Dependencies:** NA - **Twitter handle:** NA - [x] **Add tests and docs**: NA - [x] **Lint and test**: make format, make lint and make test we run successfully --------- Co-authored-by: Arthur Cheng <arthur.cheng@oracle.com> Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
128b07208e
commit
8d8d85379f
@ -158,7 +158,10 @@ class CohereProvider(Provider):
|
||||
|
||||
def chat_stream_to_text(self, event_data: Dict) -> str:
|
||||
if "text" in event_data:
|
||||
return event_data["text"]
|
||||
if "finishedReason" in event_data or "toolCalls" in event_data:
|
||||
return ""
|
||||
else:
|
||||
return event_data["text"]
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user