Skip to content

Commit 716d743

Browse files
committed
fix: Use UUID for generation_id instead of modelId
OCI doesn't provide a generation ID in responses. Previously used modelId which is the model name (e.g. 'cohere.command-r-08-2024'), not a unique generation identifier. Now generates a proper UUID.
1 parent f447f07 commit 716d743

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cohere/oci_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ def transform_oci_response_to_cohere(
876876

877877
return {
878878
"text": chat_response.get("text", ""),
879-
"generation_id": oci_response.get("modelId", str(uuid.uuid4())),
879+
"generation_id": str(uuid.uuid4()), # OCI doesn't provide generation ID, generate one
880880
"chat_history": chat_response.get("chatHistory", []),
881881
"finish_reason": chat_response.get("finishReason", "COMPLETE"),
882882
"citations": chat_response.get("citations", []),

0 commit comments

Comments
 (0)