refactor: comprehensive chatbar and agent model resolution overhaul#1060
Merged
Conversation
- Refactor agent selector component to support compact mode and improve UI - Move agent selector dropdown to chatbar for better UX - Update ontology models to remove deprecated properties and set default values for created and creator fields - Bump versions of naas-abi-core and naas-abi-marketplace packages - Update lockfiles accordingly
- Add properties for default chat and embedding model IDs in model registry interfaces and services. - Introduce MODEL_ID and get_chat_model_id for OpenRouterAgent and dynamically built OpenRouter agents. - Implement model resolution logic in API adapters to determine effective model IDs. - Enhance frontend to display resolved model names using a new models store and ModelSelector component. - Clean up legacy model ID stringification and add caching for model catalog fetches. This improves model ID handling and display consistency across the system.
Deploying abi-docs with
|
| Latest commit: |
8f7ca1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ffcb428f.abi-docs-76c.pages.dev |
| Branch Preview URL: | https://refactor-chatbar.abi-docs-76c.pages.dev |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34375004 | Triggered | Generic Password | 8f7ca1b | coder_prototype/scripts/bootstrap.sh | View secret |
| 34438430 | Triggered | Generic Password | 8f7ca1b | libs/naas-abi-cli/naas_abi_cli/cli/deploy/local_test.py | View secret |
| 34214123 | Triggered | Generic Password | 8f7ca1b | coder_prototype/docker-compose.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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.
This pull request resolves #refactor-chatbar
Summary
This PR introduces a comprehensive refactor and enhancement of the chatbar and agent model resolution system across the backend and frontend.
Key Changes
Backend
default_chat_model_idanddefault_embedding_model_idto theIModelRegistryinterface and implemented them inModelRegistryServiceto expose configured default model canonical IDs without building live models.MODEL_ID) and provide a class methodget_chat_model_idfor consistent model resolution."None"/"null") gracefully when converting database models to records.AgentRecorddataclass to include a non-persistedresolved_model_idfield representing the effective model resolved by the backend.Frontend
modelsto cache and manage the model catalog fetched from the backend.resolvedModelIdand clean legacy model ID values.AgentSelectorcomponent to support a compact mode and improved UI for model display.ModelSelectorcomponent that shows the resolved model used by the currently selected agent in a dropdown pill UI.ChatInterfaceto move the agent selector into the chatbar and add the new model selector next to it.Ontology Model Cleanup
File,Document,Processor, andChunkclasses.createdandcreatorfields using current datetime and environment user.Impact
Testing
This refactor lays the groundwork for better model management and user experience in the chat interface and agent system.