Closed Filo01 closed 1 year ago
I solved it by avoiding the expression language completely by doing it this way instead:
- name: "Write"
type: "query"
input: chunks-topic
configuration:
datasource: "JdbcDatasource"
mode: "execute"
query: |
INSERT INTO documents(filename,chunk_id,num_tokens,lang,text,embeddings_vector) values ( ? , ? , ? , ? , ? , CAST( ? as vector ) );
output-field: "value.command_result"
fields:
- "value.filename"
- "fn:toInt(value.chunk_id)"
- "fn:toInt(value.chunk_num_tokens)"
- "value.language"
- "value.text"
- "fn:toString(fn:toListOfFloat(value.embeddings_vector))"
This a full solution with PG https://github.com/LangStream/langstream/tree/main/examples/applications/query-postgresql-chat-history
I'm trying to use PGVector to store the embeddings produced by this crawler
I've added this in the
crawler.yaml
:and modified this
but I'm having this error when doing the
INSERT
ai.langstream.runtime.agent.AgentRunner$PermanentFailureException: org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.ArrayList. Use setObject() with an explicit Types value to specify the type to use.
I also tried adding this in
configuration.yaml
:And creating a PGVector via EL like this
but it's probably invalid as EL and I'm not sure how to proceed from there