I have a FastAPI app running on a remote server (with a better GPU than my personal computer) that returns a pydantic model of the form:
class PipelineResults(BaseModel):
nodes: List[BaseNode]
The API returns a serialized form of PipelineResults, and in my PC script:
response = requests.post(pipeline_url, json=json_data.model_dump(), headers=headers) # response = serialized PipelineResults
result = PipelineResults.model_validate(response.json()) # raises err
I get the error:
TypeError: Can't instantiate abstract class BaseNode with abstract methods get_content, get_metadata_str, get_type, hash, set_content
Which I assume is because the BaseNode class doesn't have a method to deserialize the dict. Is there any solution for this?
Thanks all, have loved using llamaindex so far 🙂