-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add AI Bridge request logs model filter #21259
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
base: jakehwll/ai-bridge-request-logs-improvements
Are you sure you want to change the base?
feat: add AI Bridge request logs model filter #21259
Conversation
…hwll/ai-bridge-request-logs-model
…hwll/ai-bridge-request-logs-model
…hwll/ai-bridge-request-logs-model
…hwll/ai-bridge-request-logs-model
| WHEN @model::text != '' THEN aibridge_interceptions.model ILIKE '%' || @model::text || '%' | ||
| ELSE true | ||
| END | ||
| -- Authorize Filter clause will be injected below in ListAIBridgeModelsAuthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure why this needs to be authorized. There's nothing sensitive about listing which models have been intercepted. What was your reasoning here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We scope down the interceptions to only render for a specific user at the moment (if they lack a larger permission set), I don't want to show a user models for an interception that they can't see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha 👍 good thinking. Please add a comment to this effect.
| } | ||
|
|
||
| values, errors := searchTerms(query, func(term string, values url.Values) error { | ||
| // Default to the model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment needs some more clarity.
|
|
||
| getAIBridgeModels = async (options: SearchParamOptions) => { | ||
| const url = getURLWithSearchParams( | ||
| "/api/experimental/aibridge/models", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be v2 now not experimental. Same applies for the other methods; can you please update? Better yet, define a const for the URL base for all.
This implements a simple filter for querying against AI Bridge with a given model to the frontend UI. With a simple set of backend changes to return back the models which are filterable against.
Furthermore, I made a few changes to ensure that the imports of
/filterare more understandable/scoped, they now live underRequestLogsFilter.Preview
aibridge-model-filter.mp4
@codex