Skip to content

Conversation

@danny-avila
Copy link
Owner

@danny-avila danny-avila commented Nov 11, 2025

Summary

Closes #10054

I added support for parameter management through addParams and dropParams in LLM configurations, with comprehensive test coverage for web search support across Anthropic and Google configurations

  • Added 135 lines of tests for Anthropic web search configurations with various parameter handling scenarios
  • Created a new test file for Google compatibility with 196 lines covering web search and parameter management
  • Implemented known parameter sets for both Anthropic and Google endpoints to properly route configuration values
  • Added support for addParams to enable dynamic parameter injection while respecting provider-native parameters
  • Implemented dropParams functionality to exclude specific parameters from configurations
  • Enhanced the transform utility to handle web_search as a special case separate from model configuration
  • Improved parameter routing logic to distinguish between provider-native params and OpenAI params
  • Added proper handling for Google-specific parameters like topK, maxOutputTokens, and authOptions
  • Implemented parameter cleanup logic to remove empty modelKwargs objects after dropParams processing
  • Extended type definitions to include addParams and dropParams in configuration options

Change Type

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Testing

The changes include comprehensive unit tests covering multiple scenarios:

Test Scenarios:

  • Web search enablement via addParams with web_search: true
  • Web search disablement via addParams with web_search: false
  • Web search removal via dropParams
  • Mixed parameter handling combining provider-native and OpenAI parameters
  • Parameter routing to correct configuration locations (top-level vs modelKwargs)
  • Proper handling of unknown parameters
  • Interaction between addParams and dropParams

Test Configuration:

  • Framework: Jest
  • Test files: config.anthropic.spec.ts, config.google.spec.ts
  • Coverage: Parameter routing, web search tools, configuration transformation

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

@danny-avila danny-avila changed the title Refactor/add params google anthropic 🔍 feat: Anthropic/Google Web Search Support via addParams / dropParams Nov 11, 2025
@danny-avila danny-avila merged commit 2b0fe03 into dev Nov 11, 2025
1 check passed
@danny-avila danny-avila deleted the refactor/add-params-google-anthropic branch November 11, 2025 19:39
JustinBeaudry pushed a commit to Actual-Reality/LibreChat that referenced this pull request Nov 12, 2025
…rams` (danny-avila#10456)

* feat: add support for known/add/drop parameters in Anthropic and Google LLM configurations

* ci: add tests for web search support for Anthropic and Google configurations with addParams and dropParams handling
sofvanh pushed a commit to sofvanh/LibreChat that referenced this pull request Nov 18, 2025
…rams` (danny-avila#10456)

* feat: add support for known/add/drop parameters in Anthropic and Google LLM configurations

* ci: add tests for web search support for Anthropic and Google configurations with addParams and dropParams handling
Guiraud pushed a commit to Guiraud/LibreChat that referenced this pull request Nov 21, 2025
…rams` (danny-avila#10456)

* feat: add support for known/add/drop parameters in Anthropic and Google LLM configurations

* ci: add tests for web search support for Anthropic and Google configurations with addParams and dropParams handling
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

Successfully merging this pull request may close these issues.

2 participants