Skip to content

Commit 934a06f

Browse files
committed
Updated docstrings for models
1 parent 6a021bf commit 934a06f

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

src/models/requests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Model for service requests."""
1+
"""Models for REST API requests."""
22

33
from typing import Optional, Self
44
from enum import Enum
@@ -13,17 +13,17 @@
1313

1414

1515
class Attachment(BaseModel):
16-
"""Model representing an attachment that can be send from UI as part of query.
16+
"""Model representing an attachment that can be send from the UI as part of query.
1717
18-
List of attachments can be optional part of 'query' request.
18+
A list of attachments can be an optional part of 'query' request.
1919
2020
Attributes:
2121
attachment_type: The attachment type, like "log", "configuration" etc.
2222
content_type: The content type as defined in MIME standard
2323
content: The actual attachment content
2424
2525
YAML attachments with **kind** and **metadata/name** attributes will
26-
be handled as resources with specified name:
26+
be handled as resources with the specified name:
2727
```
2828
kind: Pod
2929
metadata:
@@ -40,7 +40,7 @@ class Attachment(BaseModel):
4040
examples=["text/plain"],
4141
)
4242
content: str = Field(
43-
description="The actual attachment content", examples=["warning: quota exceed"]
43+
description="The actual attachment content", examples=["warning: quota exceeded"]
4444
)
4545

4646
# provides examples for /docs endpoint
@@ -212,7 +212,7 @@ def validate_provider_and_model(self) -> Self:
212212

213213
@model_validator(mode="after")
214214
def validate_media_type(self) -> Self:
215-
"""Log use of media_type that is unsupported but kept for backwards compatibility."""
215+
"""Log use of media_type that is unsupported but kept for backward compatibility."""
216216
if self.media_type:
217217
logger.warning(
218218
"media_type was set in the request but is not supported. The value will be ignored."

src/models/responses.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Models for service responses."""
1+
"""Models for REST API responses."""
22

33
from typing import Any, Optional
44

@@ -80,7 +80,7 @@ class QueryResponse(BaseModel):
8080

8181

8282
class InfoResponse(BaseModel):
83-
"""Model representing a response to a info request.
83+
"""Model representing a response to an info request.
8484
8585
Attributes:
8686
name: Service name.
@@ -451,16 +451,18 @@ class ConversationDetails(BaseModel):
451451
created_at: When the conversation was created.
452452
last_message_at: When the last message was sent.
453453
message_count: Number of user messages in the conversation.
454-
model: The model used for the conversation.
454+
last_used_model: The last model used for the conversation.
455+
last_used_provider: The provider of the last used model.
455456
456457
Example:
457458
```python
458-
conversation = ConversationSummary(
459+
conversation = ConversationDetails(
459460
conversation_id="123e4567-e89b-12d3-a456-426614174000"
460461
created_at="2024-01-01T00:00:00Z",
461462
last_message_at="2024-01-01T00:05:00Z",
462463
message_count=5,
463-
model="gemini/gemini-2.0-flash"
464+
last_used_model="gemini/gemini-2.0-flash",
465+
last_used_provider="gemini",
464466
)
465467
```
466468
"""
@@ -488,13 +490,15 @@ class ConversationsListResponse(BaseModel):
488490
created_at="2024-01-01T00:00:00Z",
489491
last_message_at="2024-01-01T00:05:00Z",
490492
message_count=5,
491-
model="gemini/gemini-2.0-flash"
493+
last_used_model="gemini/gemini-2.0-flash",
494+
last_used_provider="gemini",
492495
),
493496
ConversationDetails(
494497
conversation_id="456e7890-e12b-34d5-a678-901234567890"
495498
created_at="2024-01-01T01:00:00Z",
496499
message_count=2,
497-
model="gemini/gemini-2.5-flash"
500+
last_used_model="gemini/gemini-2.0-flash",
501+
last_used_provider="gemini",
498502
)
499503
]
500504
)
@@ -514,13 +518,15 @@ class ConversationsListResponse(BaseModel):
514518
"created_at": "2024-01-01T00:00:00Z",
515519
"last_message_at": "2024-01-01T00:05:00Z",
516520
"message_count": 5,
517-
"model": "gemini/gemini-2.0-flash",
521+
"last_used_model": "gemini/gemini-2.0-flash",
522+
"last_used_provider": "gemini",
518523
},
519524
{
520525
"conversation_id": "456e7890-e12b-34d5-a678-901234567890",
521526
"created_at": "2024-01-01T01:00:00Z",
522527
"message_count": 2,
523-
"model": "gemini/gemini-2.5-flash",
528+
"last_used_model": "gemini/gemini-2.5-flash",
529+
"last_used_provider": "gemini",
524530
},
525531
]
526532
}

0 commit comments

Comments
 (0)