这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: LangDB AI Custom Endpoint and conversationId as headers #8647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

MrunmayS
Copy link

@MrunmayS MrunmayS commented Jul 24, 2025

Summary

LangDB AI Custom Endpoint Integration

Added configuration for the LangDB AI custom endpoint in librechat.example.yaml. This enables LibreChat users to connect directly to the LangDB API and utilize its specialized models with settings for headers, model display, and title conversations.

Key additions:

  • Endpoint configuration for LangDB API
  • Headers for authentication with LangDB API (including conversation context)
  • Model list and label customizations
  • Conversation ID support via {{LIBRECHAT_CONVERSATION_ID}} placeholder

Headers for LangDB User Tracking:

LangDB offers comprehensive user tracking using these headers:

  • x-project-id: Project identification for API access
  • x-user-id: User identification for session tracking
  • x-user-name: User display name for personalization
  • x-email: User email for account management
  • x-user-tiers: User role/permission level
  • x-thread-id: Conversation context using {{LIBRECHAT_CONVERSATION_ID}} placeholder

These headers enable LangDB to provide personalized experiences, track usage patterns, and maintain conversation context across sessions.

Change Type

Please delete any irrelevant options.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Tested the LangDB AI endpoint configuration by setting up the API connection with provided keys and verifying model fetching, header configurations, and response outputs. Validated model retrieval and display settings align with LangDB model responses.

Test Configuration:

  • Environment Variables: Set LANGDB_API_KEY and LANGDB_PROJECT_ID for testing
  • Base URL: https://api.us-east-1.langdb.ai
  • Default Model: openai/gpt-4.1-nano

Checklist

Please delete any irrelevant options.

  • 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
  • I have made pertinent documentation changes
  • 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.

MrunmayS and others added 5 commits July 23, 2025 12:06
…alizeClient

- Introduced LangDB configuration in librechat.example.yaml, allowing for API key and model settings.
- Updated initializeClient to handle conversation IDs in customUserVars and filter unresolved headers.
- Added a test to ensure resolveHeaders is called with the conversation ID when provided.
- Updated KnownEndpoints enum to include langdb.
- Added corresponding asset path for langdb in UnknownIcon component.
@MrunmayS
Copy link
Author

Hey @danny-avila ! Can you take a look at this? TIA

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