redhat-developer / redhat-developer/rhdh-plugins
Update ai-experience plugin to query AiModelServerAPI entities
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 48
- Forks
- 120
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 337
Description
Summary
After PR #4211 (issue #4209), the model catalog entity provider emits AiModelServerAPI entities with spec.type: 'ai-model-server' instead of the previous Resource entities with spec.type: 'ai-model' (plus Component and API entities). The ai-experience plugin still queries for the old entity shapes and needs to be updated.
Affected code
-
plugins/ai-experience-backend/src/services/ModelService/ModelService.ts:73-74— queries{ kind: 'Resource', 'spec.type': 'ai-model' }, which will return zero results after the entity provider change. -
plugins/ai-experience/src/components/ModelSection/ModelSection.tsx:54-55— builds a catalog link withfilters[kind]=resource&filters[type]=ai-model, which will show no results in the UI.
What to change
Update both locations to query for { kind: 'AiModelServerAPI', 'spec.type': 'ai-model-server' } and adjust any response handling for the new entity shape (models are now in spec.models.available instead of being separate Resource entities).
Context
- PR #4211 / issue #4209 introduced the
AiModelServerAPIkind - The ai-experience plugin is expected to be replaced, but should be updated in the interim to avoid a broken model section
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with plugins/ai-experience-backend/src/services/ModelService/ModelService.ts:73-74 and plugins/ai-experience/src/components/ModelSection/ModelSection.tsx:54-55, then review PR #4211 or issue #4209 for the AiModelServerAPI entity shape. Update both queries and response handling for spec.models.available, and verify that the model section displays the available models and its catalog link returns results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- full-stack
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100