Skip to content

Commit

Permalink
don't keep sources
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerosenthal committed Jun 11, 2024
1 parent 27240b6 commit 8a984a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
4 changes: 1 addition & 3 deletions ragna/deploy/_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ def schema_to_core_chat(
chat_name=chat.metadata.name,
**chat.metadata.params,
)
core_chat._messages = [
message.to_core() for message in chat.messages
]
core_chat._messages = [message.to_core() for message in chat.messages]
core_chat._prepared = chat.prepared

return core_chat
Expand Down
19 changes: 1 addition & 18 deletions ragna/deploy/_api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ def from_core(cls, document: ragna.core.Document) -> Document:
name=document.name,
)

@classmethod
def to_core(cls, document: Document) -> ragna.core.Document:
return ragna.core.Document(
id=document.id,
name=document.name,
)


class DocumentUpload(BaseModel):
parameters: ragna.core.DocumentUploadParameters
Expand All @@ -57,16 +50,6 @@ def from_core(cls, source: ragna.core.Source) -> Source:
num_tokens=source.num_tokens,
)

@classmethod
def to_core(cls, source: Source) -> ragna.core.Source:
return ragna.core.Source(
id=source.id,
document=Document.to_core(source.document),
location=source.location,
content=source.content,
num_tokens=source.num_tokens,
)


class Message(BaseModel):
id: uuid.UUID = Field(default_factory=uuid.uuid4)
Expand All @@ -87,7 +70,7 @@ def to_core(self) -> ragna.core.Message:
return ragna.core.Message(
content=self.content,
role=self.role,
sources=[source.to_core() for source in self.sources],
sources=[],
)


Expand Down

0 comments on commit 8a984a6

Please sign in to comment.