Hi All,
I am getting the below Error when I am running a custom tool i have created to insert the data into vector db
Exception: ‘dict’ object has no attribute ‘embedding_fn’
Can someone please help in understand why the above error is coming. I am using ollama here and not OpenAI GPT
Blockquote
class AddToVectorDBTool(BaseTool):
name: str = “Add Data to Vector DB”
description: str = “Adds Data to the vector database.”
args_schema: Type[BaseModel] = Data
return_schema: Type[BaseModel] = AddToVectorDBOutput
def _run(self, details: Data) -> AddToVectorDBOutput:
try:
app = App(
embedding_model=dict(provider="ollama",config=dict(model="all-minilm")),
llm=dict(provider="ollama",config=dict(model="ollama3.1"))
)
app.add(details, data_type=DataType.JSON)
return AddToVectorDBOutput(success=True)
except Exception as e:
print(f"Exception: {e}")
return AddToVectorDBOutput(success=False)