Skip to content

[Draft] feat(openai): add deepseek compatibility support, separate entrypoints + packages#171

Draft
cabljac wants to merge 2 commits into
mainfrom
@invertase/oai-ds-split
Draft

[Draft] feat(openai): add deepseek compatibility support, separate entrypoints + packages#171
cabljac wants to merge 2 commits into
mainfrom
@invertase/oai-ds-split

Conversation

@cabljac

@cabljac cabljac commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @cabljac, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Genkit Dart framework by introducing comprehensive support for DeepSeek AI models. It establishes a new, dedicated package for DeepSeek, while simultaneously making the existing OpenAI plugin more adaptable to accommodate various OpenAI-compatible providers. This architectural change allows for seamless integration and utilization of DeepSeek's capabilities within Genkit applications, offering developers more flexibility in choosing their AI models.

Highlights

  • New DeepSeek Package: A new genkit_deepseek package has been introduced, serving as a convenience wrapper that re-exports DeepSeek support from the genkit_openai package.
  • DeepSeek Integration in genkit_openai: DeepSeek compatibility has been added directly into the genkit_openai plugin, including a dedicated DeepSeekPluginHandle and deepSeekModelInfo for proper model configuration.
  • Generic OpenAIPlugin: The core OpenAIPlugin implementation has been refactored to be more generic, allowing for custom plugin names and model information resolvers, which facilitates integration of other OpenAI-compatible providers.
  • New DeepSeek Example App: A new example application (testapps/openai_sample/lib/deepseek.dart) has been added to demonstrate various DeepSeek generation flows, including simple generation, streaming, reasoning, dynamic model resolution, and system prompt chat.
Changelog
  • packages/genkit_deepseek/lib/genkit_deepseek.dart
    • Added a new library that re-exports DeepSeek support from genkit_openai.
  • packages/genkit_deepseek/pubspec.yaml
    • Added a new pubspec file for the genkit_deepseek package, defining its dependencies and metadata.
  • packages/genkit_openai/lib/deepseek.dart
    • Added a new library providing a pre-configured plugin handle for DeepSeek's OpenAI-compatible API.
  • packages/genkit_openai/lib/genkit_openai.dart
    • Updated exports to remove redundant model information and converter exports.
    • Added a DeepSeekPluginHandle constant for easy access to DeepSeek plugin functionality.
    • Implemented the DeepSeekPluginHandle class, configuring it for DeepSeek's API endpoint and model information.
  • packages/genkit_openai/lib/src/models.dart
    • Added deepSeekModelInfo to provide specific model information for DeepSeek models, including support for tools and system roles based on model type.
  • packages/genkit_openai/lib/src/openai_plugin.dart
    • Imported converters.dart and models.dart to support new model information handling.
    • Refactored OpenAIPlugin to accept a pluginName and an optional modelInfoResolver, making it more generic.
    • Updated _getModelInfo to utilize the new modelInfoResolver if provided, allowing dynamic model info resolution.
    • Changed the model naming convention within the plugin from openai/$modelId to $name/$modelId for greater flexibility.
  • packages/genkit_openai/test/openai_plugin_test.dart
    • Added new test groups for DeepSeek Model Info to verify correct support settings for chat and reasoner models.
    • Added new test groups for DeepSeek Plugin Handle to ensure proper plugin instance creation and model reference generation.
  • pubspec.yaml
    • Updated the workspace definition to include the newly added genkit_deepseek package.
  • testapps/openai_sample/lib/deepseek.dart
    • Added a new example application demonstrating various DeepSeek generation flows, including simple, streamed, reasoner, dynamic model, and system prompt chat.
Activity
  • This pull request is currently in draft status, indicating ongoing development and no formal reviews or comments have been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces DeepSeek compatibility support by creating a new genkit_deepseek package and integrating it into the genkit_openai plugin. The changes include adding a new DeepSeekPluginHandle and deepSeekModelInfo to handle DeepSeek's specific model capabilities and API endpoint. The OpenAIPlugin has been refactored to be more generic, allowing it to be reused for other OpenAI-compatible providers. New tests have been added to validate the DeepSeek integration, and a sample application demonstrates its usage. However, a critical issue was identified: the pubspec.yaml specifies an unreleased Dart SDK version (^3.10.0), which needs to be updated to a currently available stable version to ensure the package can be built and used.

Comment thread packages/genkit_deepseek/pubspec.yaml
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