Skip to content
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

feat: enable azure v2 assistant with file search #5031

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

adnandothussain
Copy link

@adnandothussain adnandothussain commented Dec 18, 2024

Summary

This pull request adds support for Azure v2 assistant and file search functionality in LibreChat. Previously, the library supported OpenAI assistants and Azure OpenAI, but it lacked support for Azure v2 assistants and the ability to perform file_search. I have implemented the required functionality to enable Azure v2 assistants and integrated vector store-based file upload, allowing users to upload files for file search functionality in Azure OpenAI.

This update helps users who wish to use the LibreChat library with Azure v2 assistants and provides an enhanced file search experience.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

To test the changes, I configured an Azure v2 assistant and verified the file search functionality. I also tested the vector store-based file upload, ensuring that files can be uploaded and used for searching within the Azure OpenAI assistant. The tests involved using both sample and custom data to ensure robustness.

Test Configuration:

  • Used my own custom YML file attached below
  • Build and run both backend and frontend projects
  • Select Azure Assistants from the top left menu
  • On left build, select to create new assistant
  • Select your model and file_search option

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
  • 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.
  • A pull request for updating the documentation has been submitted.

Note:

These changes were done in collaboration with Network Ninja, Inc and GeeksOfKolachi

@adnandothussain
Copy link
Author

adnandothussain commented Dec 18, 2024

Custom YAML file (librechat.yaml)

# For more information, see the Configuration Guide:
# https://docs.librechat.ai/install/configuration/custom_config.html

# Configuration version (required)
version: 1.1.7

# Cache settings: Set to true to enable caching
cache: true

interface:
  endpointsMenu: true
  modelSelect: true
  parameters: true
  sidePanel: true
  presets: true
  prompts: true
  bookmarks: true
  multiConvo: true

# registration: <-- This will be custom to your local config.

# Definition of custom endpoints

fileConfig:
  endpoints:
    assistants:
      fileLimit: 5000
      fileSizeLimit: 512
      totalSizeLimit: 512
      supportedMimeTypes:
        - "image/.*"
        - "application/.*"
        - "text/.*"
    openAI:
      disabled: true
    azureOpenAI:
      disabled: false
    default:
      totalSizeLimit: 512
      supportedMimeTypes:
        - "image/.*"
        - "application/.*"
        - "text/.*"
  serverFileSizeLimit: 512
  avatarSizeLimit: 4
rateLimits:
  fileUploads:
    ipMax: 100
    ipWindowInMinutes: 60
    userMax: 100
    userWindowInMinutes: 60
endpoints:
  azureAssistants:
    disableBuilder: false
    privateAssistants: true
    pollIntervalMs: 500
    timeoutMs: 10000
    capabilities: ["code_interpreter", "actions", "file_search"]
  azureOpenAI:
    titleModel: "gpt-4o-mini"
    titleConvo: true
    plugins: true
    assistants: true
    groups:
    - group: "YOUR GROUP"
      apiKey: "YOUR API KEY"
      instanceName:  "YOUR INSTANCE NAME"
      version: "API VERSION"
      assistants: true
      models:
        gpt-4o-mini:
          deploymentName: 'gpt-4o-mini'
        gpt-4o:
          deploymentName: 'gpt-4o'

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.

1 participant