-
Notifications
You must be signed in to change notification settings - Fork 11
Feature: Add image generation tool #283
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
Draft
baasitsharief
wants to merge
114
commits into
main
Choose a base branch
from
mob/spike-multi-modal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
lastFile:ui/src/pages/Settings/MetadataDBFields.tsx
lastFile:ui/src/pages/Settings/MetadataDBFields.tsx
…rd in H2 configuration
# Conflicts: # llm-service/uv.lock
# Conflicts: # backend/src/test/java/com/cloudera/cai/util/db/RdbConfigTest.java # llm-service/app/config.py # llm-service/app/services/amp_metadata/__init__.py # llm-service/app/services/models/_model_source.py # llm-service/app/services/query/querier.py # llm-service/uv.lock # prebuilt_artifacts/fe-dist.tar.gz # prebuilt_artifacts/node-dist.tar.gz # prebuilt_artifacts/rag-api.jar # scripts/release_version.txt # ui/src/api/ampMetadataApi.ts
…efix and updating markdown link format
# Conflicts: # llm-service/app/services/models/__init__.py
…n Vite configuration
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.
Overview
What’s new
llama-index-tools-openai-image-generation
tools/image_generation_config.json
GET /cache/{filename}
serves png/jpg/etc. fromllm-service/cache
with MIME detection and long-lived cache headersChatMessage(blocks=[TextBlock(...)])
for compatibility with newer LlamaIndex versions across streaming and historyKey changes
llm-service
:GET /tools/image-generation
→ available image-gen tools for current model sourceGET /tools/image-generation/config
→ returns{ enabled, selected_tool }
POST /tools/image-generation/config
→ admin-only set config; validates tool availabilityOpenAIImageGenerationToolSpec
(DALL·E)BedrockStableDiffusionToolSpec
,BedrockTitanImageToolSpec
TextBlock
-based messages for streaming and historylist_image_generation_models()
on providers; Bedrock implementation returns IMAGE modality modelsGET /cache/{filename}
readsllm-service/cache
and returns proper content-typetoolsApi.ts
: queries/mutations for image-gen tools and configpages/Tools/ToolsPage.tsx
):RagChatTab/FooterComponents/ToolsManager.tsx
):MarkdownResponse.tsx
):llama-index-tools-openai-image-generation>=0.4.0
llama-index-llms-openai
to>=0.4.7
llama-index-llms-azure-openai
to>=0.3.4
.gitignore
: addtools/image_generation_config.json
API surface
GET /tools/image-generation
GET /tools/image-generation/config
POST /tools/image-generation/config
(admin-only)GET /cache/{filename}
(static image serving)DELETE /tools/{name}
now rejects deletion of image-gen toolsConfiguration
tools/image_generation_config.json
{ "enabled": false, "selected_tool": null }
OPENAI_API_KEY
Security and operational notes
llm-service/cache
with MIME detection and long Cache-ControlPath(file).resolve().is_relative_to(_cache_dir)
before readingBackwards compatibility
TextBlock
messages aligns with newer LlamaIndex; all internal call sites updatedHow to test
llm-service
: update env and deps (e.g.,uv sync
or your standard env refresh)OPENAI_API_KEY
/llm-service/cache/...
stability.sd3-5-large-v1:0
oramazon.titan-image-generator-v2:0
POST /tools/image-generation/config
without admin headers → 401sandbox:
prefix is strippedKnown limitations / follow-ups
/cache/{filename}
as noted abovelist_image_generation_models()
for OpenAI