-
Notifications
You must be signed in to change notification settings - Fork 52
LCORE-390: field description for ConversationDetails model #536
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
LCORE-390: field description for ConversationDetails model #536
Conversation
WalkthroughAdds descriptive metadata and examples to the ConversationDetails schema in OpenAPI docs and the corresponding Pydantic model; conversation_id remains required and is declared with Field(...). No runtime logic or control-flow changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/openapi.json (1)
1101-1191: Schema regression: conversation_id became optional with empty-string default.Defaulting to "" weakens the contract and can leak invalid IDs. Keep conversation_id required and mark it as UUID.
"ConversationDetails": { "properties": { "conversation_id": { "type": "string", - "title": "Conversation Id", - "description": "Conversation ID (UUID)", - "default": "", - "examples": [ + "title": "Conversation Id", + "description": "Conversation ID (UUID)", + "format": "uuid", + "examples": [ "c5260aec-4d82-4370-9fdf-05cf908b3f16" ] }, @@ - "type": "object", - "title": "ConversationDetails", + "type": "object", + "required": ["conversation_id"], + "title": "ConversationDetails",Optional follow-ups:
- Add format hints to timestamps and a non-negative constraint to counts (these will also be emitted automatically if the Pydantic model uses datetime and ge=0):
"created_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], + "format": "date-time", "title": "Created At", "description": "When the conversation was created", "examples": ["2024-01-01T01:00:00Z"] }, "last_message_at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], + "format": "date-time", "title": "Last Message At", "description": "When the last message was sent", "examples": ["2024-01-01T01:00:00Z"] }, "message_count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], + "minimum": 0, "title": "Message Count", "description": "Number of user messages in the conversation", "examples": [42] },
🧹 Nitpick comments (3)
docs/output.md (1)
612-617: Populate Type column and tighten wording for consistency.Specify concrete types and use “Identifier of …” phrasing.
-| conversation_id | string | Conversation ID (UUID) | -| created_at | | When the conversation was created | -| last_message_at | | When the last message was sent | -| message_count | | Number of user messages in the conversation | -| last_used_model | | Identification of the last model used for the conversation | -| last_used_provider | | Identification of the last provider used for the conversation | +| conversation_id | string (uuid) | Conversation ID (UUID) | +| created_at | string (date-time) | When the conversation was created | +| last_message_at | string (date-time) | When the last message was sent | +| message_count | integer | Number of user messages in the conversation | +| last_used_model | string | Identifier of the last model used for the conversation | +| last_used_provider | string | Identifier of the last provider used for the conversation |docs/openapi.md (1)
612-617: Mirror types/wording in the ConversationDetails table.Align with OpenAPI schema and use explicit types.
-| conversation_id | string | Conversation ID (UUID) | -| created_at | | When the conversation was created | -| last_message_at | | When the last message was sent | -| message_count | | Number of user messages in the conversation | -| last_used_model | | Identification of the last model used for the conversation | -| last_used_provider | | Identification of the last provider used for the conversation | +| conversation_id | string (uuid) | Conversation ID (UUID) | +| created_at | string (date-time) | When the conversation was created | +| last_message_at | string (date-time) | When the last message was sent | +| message_count | integer | Number of user messages in the conversation | +| last_used_model | string | Identifier of the last model used for the conversation | +| last_used_provider | string | Identifier of the last provider used for the conversation |src/models/responses.py (1)
509-519: Examples consistency: align provider/model examples across docs.Files mix “gpt-” and “gemini/” examples. Pick one convention to reduce cognitive load.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/openapi.json(6 hunks)docs/openapi.md(1 hunks)docs/output.md(1 hunks)src/models/responses.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-pr
- GitHub Check: e2e_tests
| created_at: Optional[str] = Field( | ||
| None, | ||
| description="When the conversation was created", | ||
| examples=["2024-01-01T01:00:00Z"], | ||
| ) | ||
|
|
||
| last_message_at: Optional[str] = Field( | ||
| None, | ||
| description="When the last message was sent", | ||
| examples=["2024-01-01T01:00:00Z"], | ||
| ) | ||
|
|
||
| message_count: Optional[int] = Field( | ||
| None, | ||
| description="Number of user messages in the conversation", | ||
| examples=[42], | ||
| ) |
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.
🛠️ Refactor suggestion
Use precise types and basic validation for timestamps and counts.
This tightens schema and improves docs without changing behavior.
- created_at: Optional[str] = Field(
- None,
- description="When the conversation was created",
- examples=["2024-01-01T01:00:00Z"],
- )
+ created_at: Optional[datetime] = Field(
+ None,
+ description="When the conversation was created",
+ examples=["2024-01-01T01:00:00Z"],
+ )
@@
- last_message_at: Optional[str] = Field(
- None,
- description="When the last message was sent",
- examples=["2024-01-01T01:00:00Z"],
- )
+ last_message_at: Optional[datetime] = Field(
+ None,
+ description="When the last message was sent",
+ examples=["2024-01-01T01:00:00Z"],
+ )
@@
- message_count: Optional[int] = Field(
- None,
- description="Number of user messages in the conversation",
- examples=[42],
- )
+ message_count: Optional[int] = Field(
+ None,
+ ge=0,
+ description="Number of user messages in the conversation",
+ examples=[42],
+ )Add the import:
+from datetime import datetime🤖 Prompt for AI Agents
In src/models/responses.py around lines 491 to 507, tighten the schema by using
proper datetime types for timestamps and a non-negative constrained int for
message_count: change created_at and last_message_at from Optional[str] to
Optional[datetime] and change message_count to Optional[conint(ge=0)], keep the
Field descriptions and examples but ensure examples remain ISO8601 strings, and
add the imports "from datetime import datetime" and "from pydantic import
conint" at the top of the file.
23838fe to
012b397
Compare
Description
LCORE-390: field description for ConversationDetails model
Type of change
Related Tickets & Documents
Summary by CodeRabbit