Skip to content

Add openAI websearch and claude 4 to modelproviders #7988

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

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

Conversation

liavar1
Copy link
Contributor

@liavar1 liavar1 commented May 27, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

Add openai websearch model and claude 4 to model list

📝 补充信息 | Additional Information

image

Copy link

vercel bot commented May 27, 2025

@liavar1 is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 27, 2025
@lobehubbot
Copy link
Member

👍 @liavar1

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the Model Provider 模型服务商 label May 27, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR introduces new AI models to LobeChat's provider ecosystem:

  • Added Claude 4 Opus and Sonnet models in src/config/modelProviders/anthropic.ts with advanced capabilities and pricing structures
  • Added GPT-4o mini Search Preview model in src/config/modelProviders/openai.ts with enhanced web search functionality
  • Configured search implementation settings for GPT-4o mini Search Preview in src/config/aiModels/openai.ts
  • Set future release dates (May 2025 for Claude 4 models, December 2024 for GPT-4o mini Search)
  • Maintained consistent model configuration patterns across providers

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.67%. Comparing base (a47ddc5) to head (c585a78).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7988      +/-   ##
==========================================
+ Coverage   88.41%   95.67%   +7.25%     
==========================================
  Files         822       14     -808     
  Lines       60436     2519   -57917     
  Branches     3821      244    -3577     
==========================================
- Hits        53435     2410   -51025     
+ Misses       7001      109    -6892     
Flag Coverage Δ
app ?
server 95.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@entelligence-ai-reviews

Walkthrough

This PR expands the AI model configurations by adding new and updated models for both OpenAI and Anthropic providers. It introduces the 'GPT-4o mini Search Preview' model, optimized for search and real-time information retrieval, to both the OpenAI chat models and provider configuration. For Anthropic, it adds 'Claude 4 Opus' and 'Claude 4 Sonnet' models, updates their parameters, and restores the standard 'Claude 3.7 Sonnet' model. These changes increase the available model options and update pricing, context windows, and feature support to reflect the latest releases.

Changes

File(s) Summary
src/config/aiModels/openai.ts
src/config/modelProviders/openai.ts
Added 'GPT-4o mini Search Preview' model configuration with 128,000 token context window, search optimization, pricing, release date, and feature flags.
src/config/modelProviders/anthropic.ts Added 'Claude 4 Opus' and 'Claude 4 Sonnet' models with updated descriptions, context windows, pricing, release dates, and vision support; replaced 'Claude 3.7 Sonnet Extended thinking' with standard 'Claude 3.7 Sonnet'.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    title GPT-4o mini Search Preview Integration Flow
    
    actor User
    participant Client as "Client Application"
    participant ModelRegistry as "Model Registry"
    participant ModelSelector as "Model Selector"
    participant GPT4oMiniSearch as "GPT-4o mini Search Preview"
    participant SearchTool as "Search Tool"
    participant API as "API Service"
    
    User->>Client: Request with search query
    activate Client
    
    Client->>ModelRegistry: getAvailableModels()
    activate ModelRegistry
    ModelRegistry-->>Client: Return available models (including new GPT-4o mini Search Preview)
    deactivate ModelRegistry
    
    Client->>ModelSelector: selectModel(requirements)
    activate ModelSelector
    Note over ModelSelector: Evaluates model capabilities<br/>against requirements
    
    alt Search capability required
        ModelSelector-->>Client: Select GPT-4o mini Search Preview
    else Other capabilities required
        ModelSelector-->>Client: Select different model
    end
    deactivate ModelSelector
    
    Client->>API: createChatCompletion(model="gpt-4o-mini-search-preview", messages)
    activate API
    
    API->>GPT4oMiniSearch: processRequest(messages)
    activate GPT4oMiniSearch
    
    alt search=true in abilities
        GPT4oMiniSearch->>SearchTool: performSearch(query)
        activate SearchTool
        Note over SearchTool: searchImpl="tool" from settings
        SearchTool-->>GPT4oMiniSearch: Return search results
        deactivate SearchTool
        
        GPT4oMiniSearch->>GPT4oMiniSearch: incorporateSearchResults()
        Note over GPT4oMiniSearch: Uses 128k context window
    end
    
    GPT4oMiniSearch-->>API: Return response
    deactivate GPT4oMiniSearch
    
    API-->>Client: Return completion response
    deactivate API
    
    Client-->>User: Display response with search-enhanced information
    deactivate Client
    
    Note over User, SearchTool: Pricing applied:<br/>- Input: $0.15/1K tokens (or $0.075/1K for cached)<br/>- Output: $0.60/1K tokens<br/>- Max output: 16,384 tokens
Loading

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

@liavar1 liavar1 requested a review from arvinxx May 28, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Model Provider 模型服务商 size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants