Exception: error returned from database: function pgml.transform(task => jsonb, inputs => jsonb[], args => jsonb) does not exist
async def main(): collection = Collection("test_collection")
pipeline = Pipeline(
"v3",
{
"text": {
"splitter": {"model": "recursive_character"},
"semantic_search": {
"model": "mixedbread-ai/mxbai-embed-large-v1",
},
"full_text_search": {"configuration": "english"},
}
}
)
await collection.add_pipeline(pipeline)
documents = [
{"id": "1", "text": "Korvus is incredibly fast and easy to use."},
{"id": "2", "text": "Tomatoes are incredible on burgers."},
]
await collection.upsert_documents(documents)
results = await collection.rag(
{
"CONTEXT": {
"vector_search": {
"query": {
"fields": {
"text": {
"query": "Is Korvus fast?",
"parameters": {
"prompt": "Represent this sentence for searching relevant passages: "
},
}
},
},
"document": {"keys": ["id"]},
"limit": 5,
},
"aggregate": {"join": "\n"},
},
"chat": {
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
"messages": [
{
"role": "system",
"content": "You are a friendly and helpful chatbot",
},
{
"role": "user",
"content": "Given the context\n:{CONTEXT}\nAnswer the question: Is Korvus fast?",
},
],
"max_tokens": 100,
},
},
pipeline,
)
print(results)
Run the asynchronous function
asyncio.run(main()) print("DONE!")
with this code
I got Added Pipeline v3, Now Syncing... Done Syncing v3 Upserting Documents...
Done Upserting Documents
[00:00:01] ████████████████████████████████████████ 2/2 Traceback (most recent call last):
File "/media/pkl43150324/Projects/test/Projects/korvus_test/test2.py", line 219, in
What version of pgml are you using? Can you run \dx in your database and share the output?
Closing this as it seems to be an isolated issue and most likely has to do with the version of pgml they are running.