feat: add Novita AI as LLM provider#800
Open
Alex-wuhu wants to merge 1 commit intosupermemoryai:mainfrom
Open
Conversation
Adds a dedicated Novita AI provider integration following the OpenAI SDK pattern: - New novita submodule with withSupermemory middleware - Supports OpenAI-compatible endpoint (https://api.novita.ai/openai) - Uses NOVITA_API_KEY env var for authentication - Exports NOVITA_MODELS constants with model IDs (kimi-k2.5, glm-5, minimax-m2.5) - Includes unit tests for the integration
|
|
||
| const conversationId = options?.conversationId | ||
| const mode = options?.mode ?? "profile" | ||
| const addMemory = options?.addMemory ?? "never" |
There was a problem hiding this comment.
Bug: The addMemory option is declared and its value is read, but it is never used, causing the conversation-saving feature to silently fail when enabled.
Severity: CRITICAL
Suggested Fix
In createWithMemory and createResponsesWithMemory, add logic to check if addMemory is set to "always". If it is, call the addMemoryTool() function to persist the conversation content to Supermemory, similar to the implementation in openai/middleware.ts.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/tools/src/novita/middleware.ts#L49
Potential issue: The `addMemory` configuration option is defined in the
`NovitaMiddlewareOptions` and its value is captured in the `novita` middleware function,
but the variable is never subsequently used. This means that when a user sets
`addMemory: "always"`, expecting conversations to be saved, the functionality will
silently fail. Unlike the corresponding OpenAI middleware, the Novita implementation
lacks the logic in `createWithMemory` and `createResponsesWithMemory` to check this flag
and call a memory-saving utility like `addMemoryTool()`. This results in a functional
gap where conversations are never persisted to memory.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Novita AI as a new LLM provider. Novita offers an OpenAI-compatible API with competitive pricing and a wide selection of open-source models.
Changes
NOVITA_API_KEYenvironment variableConfiguration
Endpoint:
https://api.novita.ai/openai