davsclaus opened a new pull request, #30975:
URL: https://github.com/apache/camel/pull/30975

   # Description
   
   Part of [CAMEL-23832](https://issues.apache.org/jira/browse/CAMEL-23832). 
The umbrella ticket stays open.
   
   ## Summary
   
   This PR rewrites the component description, 5 option texts (`collection`, 
`dataSource`, `dimension`, `distanceType` and
   the component `configuration`) and 5 header texts (`CamelPgVectorAction`, 
`CamelPgVectorRecordId`,
   `CamelPgVectorTextContent`, `CamelPgVectorMetadata` and 
`CamelPgVectorFilterParams`) of pgvector. The texts of the
   `action` option, `CamelPgVectorQueryTopK` and `CamelPgVectorFilter` were 
correct, so they stay as they were.
   
   What was wrong with the old texts:
   
   - `dimension` did not say that only CREATE_TABLE reads it, for the 
`vector(n)` column, or that it must match the
     embedding model.
   - `distanceType` mentioned only the similarity search. It also selects the 
operator class of the HNSW index that
     CREATE_INDEX creates, and a search uses the index only when both have the 
same distance type.
   - `collection` did not say that the name must be a plain SQL identifier, 
which the producer checks.
   - The component `configuration` option had the text "The configuration;".
   - `CamelPgVectorRecordId` did not say that UPSERT generates a random UUID 
when it is not set, that DELETE requires it,
     or that the id column holds at most 36 characters.
   - `CamelPgVectorMetadata` said "stored as JSON", but the column is TEXT and 
the producer does not check the value.
   
   Sources: the Camel code (`PgVectorProducer`, `PgVectorConfiguration`, 
`PgVectorDistanceType`, the data type
   transformers) and the pgvector documentation for the distance operators and 
operator classes (pgvector-java 0.1.6).
   
   ### Found, not changed
   
   - The `dataSource` option is required in practice (the endpoint fails to 
start without one), but the metadata does not
     mark it as `required`, likely because it is autowired.
   - The description of the `pgvector:embeddings` data type transformer 
("Prepares the message to become an object
     writable by PgVector component") is vague. It is not an option, so it is 
outside this PR.
   - `PgVectorEmbeddingsDataTypeTransformer` builds the metadata JSON by hand 
and escapes only `\`, `"`, newline, carriage
     return and tab, so a metadata value with another control character gives 
invalid JSON.
   - The generator drops double quotes from descriptions, so the example of 
`CamelPgVectorFilterParams` shows the list
     values without quotes.
   
   ## Tests
   
   - There is no new test, as only description text changes.
   - A script compared the component JSON with the parent commit: only 
`description` fields changed (14 texts: the
     component description, 4 component options, 4 endpoint options and 5 
headers).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I ran the formatter and built the module, then regenerated the catalog 
copy, `dsl/camel-endpointdsl` and `dsl/camel-componentdsl`, and committed all 
generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to