feat: support for ollama prerendered agent block list and disable api key field#471
feat: support for ollama prerendered agent block list and disable api key field#471justserdar wants to merge 2 commits intosimstudioai:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@justserdar is attempting to deploy a commit to the Sim Studio Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
PR Summary
Enhances Ollama integration by modifying client-side initialization and API key handling in the agent block interface. Changes primarily focus on improved local model support and conditional UI rendering.
- Modified
apps/sim/providers/ollama/index.tsto remove client-side initialization guard and standardize API key to 'ollama' - Updated
apps/sim/blocks/blocks/agent.tsto conditionally hide API key field for local Ollama models - Issue: Page refresh causes API key field to incorrectly reappear for local models
- Pending: API provider endpoint needs additional
isSelfHostedcheck for Ollama-specific handling
2 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
| try { | ||
| const response = await fetch(`${OLLAMA_HOST}/api/tags`) | ||
| if (!response.ok) { | ||
| console.log('response', response) |
There was a problem hiding this comment.
style: Avoid using console.log for debugging in production code. Use the logger instead for consistency.
| console.log('response', response) | |
| logger.debug('response', response) |
apps/sim/blocks/blocks/agent.ts
Outdated
| // Include all Ollama models for which we don't show the API key field | ||
| value: [ | ||
| // Ollama models | ||
| ...useOllamaStore.getState().models, |
There was a problem hiding this comment.
style: Store state accessed twice - consider memoizing or moving to a constant to avoid potential inconsistencies between the two calls.
5fec813 to
b42c43a
Compare
|
resolved by #884 |
The PR is a WIP the last weeks including back and forth conversations with hummus, it adds the missing prerendered Ollama list in the AI agent block and conditionally renders the api key field for only the
base models.Description
envis correct, setting the righturlof the consumers ollama instance is required.is required as ollama api key, this is handled in the current ollama provider. Changed value fromemptytoollama`.api/prodivers.tsendpoint.Important:
Point 2 needs correct
envpassthrough viaOLLAMA_URL.Point 4 needs work because on page refresh the
api key fieldis still being rendered while it wasn't before the page reload.Point 5 need work just for ollama in self hosted situations, so we might need to add another check like
isHosted, suggestion:isSelfHostedandisSelfHostedModelto make handling these situations more elegantly.Type of change
How Has This Been Tested?
Locally on windows 10 and ZimaCube (ZimaOS / Docker)
Checklist:
bun run test)Security Considerations:
Additional Information:
Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.