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
Original message error: TypeError: Can't instantiate abstract class BaseArtifact without an implementation for abstract methods 'get_referenced_variables', 'render'
branch: prompts2
Problem: When trying to send a prompt in the endpoint after creating the following schema and model, the API returns the warning about abstract methods.
schema.py
from abc import abstractmethod
class TextArtifact(BaseModel):
"""
Artifact for textual inputs.
"""
content: str
content_encoding: str = "utf-8"
type: str = "text"
@abstractmethod
def abst_def():
pass
model.py
from datetime import UTC, datetime # noqa: I001
from typing import Optional
from beanie import Document, Indexed
from .schemas import TextArtifact
class ChatCompletionModel(Document):
"""
Chat completion model for CRUD operations.
"""
chat_completion: TextArtifact
name: Indexed(str)
created_at: datetime
updated_at: datetime = datetime.now(UTC)
type: str = "chat_message"
role: str
sender_name: Optional[str] = None
render: dict
prompt: str
def get_referenced_variables(self):
"""
Doc.
"""
print('get_red method')
def render(self):
"""
Doc
"""
print('render method')
The text was updated successfully, but these errors were encountered:
Original message error:
TypeError: Can't instantiate abstract class BaseArtifact without an implementation for abstract methods 'get_referenced_variables', 'render'
branch:
prompts2
Problem: When trying to send a prompt in the endpoint after creating the following schema and model, the API returns the warning about abstract methods.
schema.py
model.py
The text was updated successfully, but these errors were encountered: