Rename embedchain to mem0 and open sourcing code for long term memory (#1474)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
This commit is contained in:
46
embedchain/examples/rest-api/models.py
Normal file
46
embedchain/examples/rest-api/models.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from typing import Optional
|
||||
|
||||
from database import Base
|
||||
from pydantic import BaseModel, Field
|
||||
from sqlalchemy import Column, Integer, String
|
||||
|
||||
|
||||
class QueryApp(BaseModel):
|
||||
query: str = Field("", description="The query that you want to ask the App.")
|
||||
|
||||
model_config = {
|
||||
"json_schema_extra": {
|
||||
"example": {
|
||||
"query": "Who is Elon Musk?",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class SourceApp(BaseModel):
|
||||
source: str = Field("", description="The source that you want to add to the App.")
|
||||
data_type: Optional[str] = Field("", description="The type of data to add, remove it for autosense.")
|
||||
|
||||
model_config = {"json_schema_extra": {"example": {"source": "https://en.wikipedia.org/wiki/Elon_Musk"}}}
|
||||
|
||||
|
||||
class DeployAppRequest(BaseModel):
|
||||
api_key: str = Field("", description="The Embedchain API key for App deployments.")
|
||||
|
||||
model_config = {"json_schema_extra": {"example": {"api_key": "ec-xxx"}}}
|
||||
|
||||
|
||||
class MessageApp(BaseModel):
|
||||
message: str = Field("", description="The message that you want to send to the App.")
|
||||
|
||||
|
||||
class DefaultResponse(BaseModel):
|
||||
response: str
|
||||
|
||||
|
||||
class AppModel(Base):
|
||||
__tablename__ = "apps"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
app_id = Column(String, unique=True, index=True)
|
||||
config = Column(String, unique=True, index=True)
|
||||
Reference in New Issue
Block a user