feat(duckdb): add duckdb custom_user_agent #487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DuckDB has a
custom_user_agentfield that is used by hosted services like MotherDuck to identify the integration (python), framework (SQLAlchemy or none, depending on whether the loader is used) and the integration (LangChain!).This PR adds the
langchainidentifier to 2 out of the 3 DuckDB paths. The vectorstore was impractical to add it to, since it expects the end user to create the DuckDB connection first. It might be more ergonomic to have the user pass the connection string, but that's a side quest for a different Christmas.Adding conditional logic to
sql_database.pyis not ideal -- should I create a helper likefrom_cnosdb()instead?tests/unit_tests/document_loaders/test_recursive_url_loader.pyfail for me. These seem unrelated to my changes; let's see what CI says.Gen AI disclaimer: I use Claude Code to generate the first iteration, then pair program with it until the code meets my intent and standards. I am responsible for every line of code proposed.