feat(graphile-llm): add onQuotaExceeded option to control embedding failure behavior#1291
Open
pyramation wants to merge 1 commit into
Open
feat(graphile-llm): add onQuotaExceeded option to control embedding failure behavior#1291pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
…ailure behavior
Add 'degrade' | 'throw' option at the plugin level:
- 'degrade' (default): skip vector search silently, fall back to text adapters
- 'throw': always error when embedder fails, even if text adapters exist
Configurable via createLlmTextSearchPlugin({ onQuotaExceeded: 'throw' })
or GraphileLlmPreset({ onQuotaExceeded: 'throw' }).
When no text adapters are available, throws regardless of this setting.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Adds
onQuotaExceeded: 'degrade' | 'throw'option tocreateLlmTextSearchPlugin()andGraphileLlmPreset().When the embedder returns null (billing quota exceeded, provider unavailable), the current behavior silently falls back to text-only search. This is fine for most cases, but some apps need semantic search to be critical — keyword-only results are unacceptable.
When no text adapters exist on the table, throws regardless of this setting (no fallback possible).
The option flows through:
GraphileLlmOptions.onQuotaExceeded→createLlmTextSearchPlugin({ onQuotaExceeded })→embedTextInWhere(where, embedder, hasTextAdapters, onQuotaExceeded).6 new unit tests covering both modes + edge cases (no text adapters, successful embed in throw mode).
Link to Devin session: https://app.devin.ai/sessions/4a9f098c74fb4cb6a9b6868fcff321db
Requested by: @pyramation