You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MachineUtilizationModel(ZepModel):
action_txt: str = Field(default=None, description="Action text")
action: bool = Field(default=False, description="Action flag")
response: dict = Field(default=None, description="Response text")
class Config:
arbitrary_types_allowed = True
def sanitize_json_string(json_string):
client = Zep()
session_id = str(uuid.uuid4())
print(f"Sanitizing JSON string: {json_string} in zep session: {session_id}")
# Define the model schema
model_schema = MachineUtilizationModel.schema()
extracted_data = client.memory.extract(
session_id=session_id,
model=model_schema,
last_n=1, # Assuming the JSON string is the last message
validate=True, # Enable validation for better accuracy
current_date_time='2024-07-02T07:46:49Z' # Current date and time in ISO 8601 format
)
import ipdb; ipdb.set_trace()
return extracted_data
I get
extracted_data = client.memory.extract(
File "/Users/jlangr/anaconda3/anaconda3/envs/b310/lib/python3.10/site-packages/zep_cloud/external_clients/memory.py", line 68, in extract
model_schema = json.dumps(model.model_json_schema())
AttributeError: 'dict' object has no attribute 'model_json_schema'
The text was updated successfully, but these errors were encountered:
When running
I get
The text was updated successfully, but these errors were encountered: