-SKIP
-DATASET CSV empty

--


-CASE BadParams

-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/llm/build/libllm.kuzu_extension"
---- ok

-STATEMENT return create_embedding('hello')
---- error
Binder exception: Function CREATE_EMBEDDING did not receive correct arguments:
Actual:   (STRING)
Expected: (STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,INT64) -> LIST
          (STRING,STRING,STRING,INT64,STRING) -> LIST

-STATEMENT return create_embedding('hello', 'olama')
---- error
Binder exception: Function CREATE_EMBEDDING did not receive correct arguments:
Actual:   (STRING,STRING)
Expected: (STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,INT64) -> LIST
          (STRING,STRING,STRING,INT64,STRING) -> LIST

-STATEMENT return create_embedding('hello', 'olama', 'nomic-text-embed')
---- error
Binder exception: Provider not found: olama
For more information, please refer to the official Kuzu documentation: https://docs.kuzudb.com/extensions/llm/

-STATEMENT return create_embedding('hello', 'ollama', 'MODEL_DNE')
---- error(regex)
^Connection exception: Request failed with status \d{3}\n Body: \{[\s\S]+\}[\s\S]*

-CASE BadCast

-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/llm/build/libllm.kuzu_extension"
---- ok

-STATEMENT CREATE NODE TABLE Book(id SERIAL PRIMARY KEY, title STRING, title_embedding FLOAT[766], published_year INT64);
---- ok

-STATEMENT CREATE (b:Book {title: 'The Quantum World', published_year: 2004});
---- ok

-STATEMENT MATCH (b:Book) WITH b, create_embedding(b.title, 'ollama', 'nomic-embed-text') AS emb SET b.title_embedding = emb;
---- error
Conversion exception: Unsupported casting LIST with incorrect list entry to ARRAY. Expected: 766, Actual: 768.

-CASE FailedPost

-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/llm/build/libllm.kuzu_extension"
---- ok

-STATEMENT CREATE NODE TABLE Book(id SERIAL PRIMARY KEY, title STRING, title_embedding FLOAT[768], published_year INT64);
---- ok

-STATEMENT CREATE (b:Book {title: 'The Quantum World', published_year: 2004});
---- ok

-CASE UnsupportedParams

-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/llm/build/libllm.kuzu_extension"
---- ok

-STATEMENT return create_embedding('this better fail', 'ollama', 'nomic-embed-text', 50)
---- error
Binder exception: Function CREATE_EMBEDDING for ollama did not receive correct arguments:
Actual:   (STRING,STRING,STRING,INT64)
Expected: (STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,STRING) -> LIST
For more information, please refer to the official Kuzu documentation: https://docs.kuzudb.com/extensions/llm/

-STATEMENT return create_embedding('this better fail', 'ollama', 'nomic-embed-text', 'badEndpoint')
---- error
Connection exception: Request failed: Could not connect to server <badendpoint> 
For more information, please refer to the official Kuzu documentation: https://docs.kuzudb.com/extensions/llm/

-STATEMENT return create_embedding('this better fail', 'ollama', 'nomic-embed-text', 50, 'badRegion')
---- error
Binder exception: Function CREATE_EMBEDDING for ollama did not receive correct arguments:
Actual:   (STRING,STRING,STRING,INT64,STRING)
Expected: (STRING,STRING,STRING) -> LIST
          (STRING,STRING,STRING,STRING) -> LIST
For more information, please refer to the official Kuzu documentation: https://docs.kuzudb.com/extensions/llm/

-STATEMENT return create_embedding('this better fail', 'ollama', 'nomic-embed-text', -50, 'badRegion')
---- error
Binder exception: Dimensions should be greater than 0. Got: -50.
For more information, please refer to the official Kuzu documentation: https://docs.kuzudb.com/extensions/llm/
