-
Notifications
You must be signed in to change notification settings - Fork 72
LCORE-383: Removing attachment metadata at conversation end point and streamlining o… #983
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| """Models for REST API responses.""" | ||
|
|
||
| from typing import Any, ClassVar, Literal, Optional, Union | ||
| from typing import Any, ClassVar, Literal, Optional, Union, TYPE_CHECKING | ||
|
|
||
| from fastapi import status | ||
| from pydantic import BaseModel, Field | ||
|
|
@@ -13,6 +13,9 @@ | |
| from quota.quota_exceed_error import QuotaExceedError | ||
| from utils.types import RAGChunk, ReferencedDocument, ToolCallSummary, ToolResultSummary | ||
|
|
||
| if TYPE_CHECKING: | ||
| from models.requests import Attachment | ||
|
|
||
|
Comment on lines
+16
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify models/requests.py does NOT import from models/responses.py (circular import check)
echo "=== Imports in models/requests.py ==="
rg -n "from models.responses\|import models.responses" --type py
# Verify no model_rebuild() call exists for Message
echo ""
echo "=== model_rebuild calls ==="
rg -n "model_rebuild" --type py src/Repository: lightspeed-core/lightspeed-stack Length of output: 142 🏁 Script executed: #!/bin/bash
echo "=== Lines 1-30 of src/models/responses.py ==="
head -30 src/models/responses.py | cat -n
echo ""
echo "=== Lines 825-835 of src/models/responses.py ==="
sed -n '825,835p' src/models/responses.py | cat -n
echo ""
echo "=== Check if Attachment is used in responses.py ==="
rg -n "Attachment" src/models/responses.pyRepository: lightspeed-core/lightspeed-stack Length of output: 2073 🏁 Script executed: #!/bin/bash
echo "=== All TYPE_CHECKING imports in responses.py ==="
rg -n "if TYPE_CHECKING" src/models/responses.py -A 2
echo ""
echo "=== Verify Message class definition ==="
rg -n "^class Message" src/models/responses.py -A 5Repository: lightspeed-core/lightspeed-stack Length of output: 437 Remove
Verification confirms no circular import exists; Fix-from typing import Any, ClassVar, Literal, Optional, Union, TYPE_CHECKING
+from typing import Any, ClassVar, Literal, Optional, Union
from fastapi import status
from pydantic import BaseModel, Field
from pydantic_core import SchemaError
from constants import MEDIA_TYPE_EVENT_STREAM
from models.config import Action, Configuration
+from models.requests import Attachment
from quota.quota_exceed_error import QuotaExceedError
from utils.types import RAGChunk, ReferencedDocument, ToolCallSummary, ToolResultSummary
-if TYPE_CHECKING:
- from models.requests import Attachment
-Update line 829: - attachments: Optional[list["Attachment"]] = Field(
+ attachments: Optional[list[Attachment]] = Field(🤖 Prompt for AI Agents |
||
| SUCCESSFUL_RESPONSE_DESCRIPTION = "Successful response" | ||
| BAD_REQUEST_DESCRIPTION = "Invalid request format" | ||
| UNAUTHORIZED_DESCRIPTION = "Unauthorized" | ||
|
|
@@ -810,6 +813,7 @@ class Message(BaseModel): | |
| Attributes: | ||
| content: The message content. | ||
| type: The type of message. | ||
| attachments: Optional list of attachments included with the message. | ||
| """ | ||
|
|
||
| content: str = Field( | ||
|
|
@@ -822,6 +826,10 @@ class Message(BaseModel): | |
| description="The type of message", | ||
| examples=["user", "assistant", "system", "developer"], | ||
| ) | ||
| attachments: Optional[list["Attachment"]] = Field( | ||
| default=None, | ||
| description="Optional attachments included with this message", | ||
| ) | ||
|
|
||
|
|
||
| class ConversationTurn(BaseModel): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.