Implement PR review
This commit is contained in:
parent
b976f5b7a6
commit
2bfc657e90
2 changed files with 3 additions and 9 deletions
|
|
@ -19,11 +19,9 @@ class DataPoint(BaseModel):
|
||||||
id: UUID = Field(default_factory=uuid4)
|
id: UUID = Field(default_factory=uuid4)
|
||||||
created_at: int = Field(default_factory=lambda: int(datetime.now(timezone.utc).timestamp() * 1000))
|
created_at: int = Field(default_factory=lambda: int(datetime.now(timezone.utc).timestamp() * 1000))
|
||||||
updated_at: int = Field(default_factory=lambda: int(datetime.now(timezone.utc).timestamp() * 1000))
|
updated_at: int = Field(default_factory=lambda: int(datetime.now(timezone.utc).timestamp() * 1000))
|
||||||
version: str = "0.1" # Default version
|
version: str = "1" # Default version
|
||||||
source: Optional[str] = None # Path to file, URL, etc.
|
|
||||||
type: Optional[str] = "text" # "text", "file", "image", "video"
|
type: Optional[str] = "text" # "text", "file", "image", "video"
|
||||||
topological_rank: Optional[int] = 0
|
topological_rank: Optional[int] = 0
|
||||||
extra: Optional[str] = "extra" # For additional properties
|
|
||||||
_metadata: Optional[MetaData] = {
|
_metadata: Optional[MetaData] = {
|
||||||
"index_fields": [],
|
"index_fields": [],
|
||||||
"type": "DataPoint"
|
"type": "DataPoint"
|
||||||
|
|
@ -33,7 +31,6 @@ class DataPoint(BaseModel):
|
||||||
class Config:
|
class Config:
|
||||||
underscore_attrs_are_private = True
|
underscore_attrs_are_private = True
|
||||||
|
|
||||||
@classmethod
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_embeddable_data(self, data_point):
|
def get_embeddable_data(self, data_point):
|
||||||
if data_point._metadata and len(data_point._metadata["index_fields"]) > 0 \
|
if data_point._metadata and len(data_point._metadata["index_fields"]) > 0 \
|
||||||
|
|
@ -56,9 +53,9 @@ class DataPoint(BaseModel):
|
||||||
"""Retrieve names of embeddable properties."""
|
"""Retrieve names of embeddable properties."""
|
||||||
return data_point._metadata["index_fields"] or []
|
return data_point._metadata["index_fields"] or []
|
||||||
|
|
||||||
def update_version(self, new_version: str):
|
def update_version(self):
|
||||||
"""Update the version and updated_at timestamp."""
|
"""Update the version and updated_at timestamp."""
|
||||||
self.version = new_version
|
self.version += 1
|
||||||
self.updated_at = int(datetime.now(timezone.utc).timestamp() * 1000)
|
self.updated_at = int(datetime.now(timezone.utc).timestamp() * 1000)
|
||||||
|
|
||||||
# JSON Serialization
|
# JSON Serialization
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,6 @@ class OpenAIAdapter(LLMInterface):
|
||||||
self.streaming = streaming
|
self.streaming = streaming
|
||||||
base_config = get_base_config()
|
base_config = get_base_config()
|
||||||
if base_config.monitoring_tool == MonitoringTool.LANGFUSE:
|
if base_config.monitoring_tool == MonitoringTool.LANGFUSE:
|
||||||
# set callbacks
|
|
||||||
# litellm.success_callback = ["langfuse"]
|
|
||||||
# litellm.failure_callback = ["langfuse"]
|
|
||||||
self.aclient.success_callback = ["langfuse"]
|
self.aclient.success_callback = ["langfuse"]
|
||||||
self.aclient.failure_callback = ["langfuse"]
|
self.aclient.failure_callback = ["langfuse"]
|
||||||
self.client.success_callback = ["langfuse"]
|
self.client.success_callback = ["langfuse"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue