-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Update OpenAPI spec: Restructure delta property for tool-related events #135
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
Conversation
WalkthroughThe pull request modifies the OpenAPI specification for Cohere's event schemas, specifically restructuring the Changes
Sequence DiagramsequenceDiagram
participant Client
participant Cohere API
Client->>Cohere API: Request with tool calls
Cohere API-->>Client: Streamed events
Note over Cohere API: Event structure updated
Cohere API->>Client: Events with new `message` object
Note right of Client: Receives consolidated tool call data
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/libs/Cohere/openapi.yaml (3)
12483-12487
: LGTM! Consider updating documentation.The restructuring of
tool_calls
undermessage
maintains schema consistency and follows the same pattern as other events.Consider adding a code comment or updating the documentation to explain the relationship between
message.tool_calls
andToolCallV2
schema.
12499-12509
: Consider type enhancement for function.arguments.While the structure is logically organized, the
arguments
field being a string type suggests it might contain JSON-encoded data. Consider whether a more specific schema would be beneficial.If
arguments
contains structured data, consider:
- Using a specific schema type instead of string
- Adding a format hint (e.g.,
format: json
) if it must remain as string- Adding an example in the schema to show the expected format
arguments: type: string + description: JSON-encoded function arguments + example: '{"param1": "value1", "param2": 42}'
Line range hint
12467-12509
: Architectural improvement in event schema organization.The restructuring of events to use a consistent
message
-based structure is a good architectural decision that:
- Provides a unified pattern across different event types
- Maintains clear separation of concerns
- Allows for future extensibility under the
message
objectConsider documenting this pattern in the API documentation to help consumers understand the event structure consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (19)
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2Delta.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessage.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessage.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessageToolCalls.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessageToolCalls.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessageToolCallsFunction.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallDeltaEventVariant2DeltaMessageToolCallsFunction.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallStartEventVariant2Delta.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallStartEventVariant2DeltaMessage.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallStartEventVariant2DeltaMessage.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallStartEventVariant2DeltaToolCall.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolCallStartEventVariant2DeltaToolCallType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolPlanDeltaEventVariant2Delta.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolPlanDeltaEventVariant2DeltaMessage.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.ChatToolPlanDeltaEventVariant2DeltaMessage.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.ChatToolCallStartEventVariant2DeltaToolCallType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.ChatToolCallStartEventVariant2DeltaToolCallTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContext.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContextTypes.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Cohere/openapi.yaml
(3 hunks)
🔇 Additional comments (1)
src/libs/Cohere/openapi.yaml (1)
12467-12471
: LGTM! Verify client compatibility with the new structure.The restructuring of
tool_plan
under amessage
object provides better organization while maintaining the same data type.Run this script to check for existing client implementations that might need updates:
✅ Verification successful
Restructuring of
tool_plan
is safe to proceedBased on the codebase analysis, the change to nest
tool_plan
under amessage
object is safe. The search revealed that:
- The generated C# client code already handles tool plan data through strongly-typed models
- The tool plan functionality is properly encapsulated in event-specific classes like
ChatToolPlanDeltaEvent
andChatToolPlanDeltaEventVariant2
- No direct string access patterns to
delta.tool_plan
were found in the codebaseThe change maintains backward compatibility since:
- The data type remains a string
- The client code uses proper serialization/deserialization through generated models
- The restructuring is consistent with other event types in the API
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for direct references to delta.tool_plan that need updating rg -l "delta.*tool_plan" --type cs --type ts --type jsLength of output: 56
Script:
#!/bin/bash # Let's try a broader search for tool_plan usage and delta references rg "tool_plan|delta" --type ts --type js --type cs -C 2 # Also search for any Cohere client implementations fd -e ts -e js -e cs -e tsx -e jsx --exec grep -l "Cohere"Length of output: 65693
Summary by CodeRabbit
delta
property in chat tool call eventsmessage
object