Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: error returned from database: function pgml.transform(task => jsonb, inputs => jsonb[], args => jsonb) does not exist #16

Open
PragnakalpDev29 opened this issue Sep 12, 2024 · 1 comment
Assignees

Comments

@PragnakalpDev29
Copy link

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
asyncio.run(main())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/media/pkl43150324/Projects/test/Projects/korvus_test/test2.py", line 179, in main
results = await collection.rag(
Exception: error returned from database: function pgml.transform(task => jsonb, inputs => jsonb[], args => jsonb) does not exist

@SilasMarvin
Copy link
Collaborator

What version of pgml are you using? Can you run \dx in your database and share the output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants