feat: add OCID resolution for all GenAI models (fixes 404 on OpenAI)

Models like OpenAI GPT-5.2 require the full OCID rather than the short
model_id. The catalog now maps model IDs to OCIDs per region (us-ashburn-1).
_call_genai and _embed_text resolve the OCID for the configured region
at runtime, falling back to short model_id for unmapped regions.

New models added from OCI portal: GPT-5.3/5.2/5.1/5 Codex, GPT Image
1/1.5, Llama Guard 4, ProtectAI DeBERTa, OpenAI Text Embedding 3
Large/Small. Total: 69 chat + 11 embedding models.
This commit is contained in:
nogueiraguh
2026-03-03 19:50:55 -03:00
parent 408ca45ee3
commit dcd2685671
2 changed files with 198 additions and 91 deletions

View File

@@ -32,7 +32,8 @@ The platform combines security compliance scanning, AI-powered chat with **RAG (
### 🤖 AI Chat Agent with RAG
- **OCI Generative AI** integration via official SDK (`oci.generative_ai_inference`)
- **RAG (Retrieval-Augmented Generation)**: automatically queries ADB vector store for relevant context before generating responses
- 63 models across 5 providers: **Cohere** (Command A/R/R+), **Meta** (Llama 4/3.3/3.2/3.1), **Google** (Gemini 2.5 Pro/Flash/Flash-Lite), **OpenAI** (GPT-5.2/5.1/5/4.1/4o, o1/o3/o4-mini, GPT Audio, GPT-oss), **xAI** (Grok 4.1/4/3 + reasoning/fast variants)
- 69 chat models + 11 embedding models across 6 providers: **Cohere**, **Meta**, **Google**, **OpenAI** (GPT-5.3/5.2/5.1/5/4.1/4o, Codex, Image, Audio, o1/o3/o4-mini, GPT-oss), **xAI** (Grok 4.1/4/3), **ProtectAI**
- OCID-based model resolution: catalog maps model IDs to OCI resource IDs per region for reliable API calls
- 16 OCI regions supported with auto-generated endpoints
- Full parameter control: temperature, max_tokens, top_p, top_k, frequency/presence penalty
- Conversation history with session management
@@ -399,7 +400,9 @@ oci-cis-agent/
---
## Supported GenAI Models (63 Chat + 9 Embedding)
## Supported GenAI Models (69 Chat + 11 Embedding)
All models include OCID mapping for `us-ashburn-1`. For other regions, use the "Personalizado (usar OCID)" option.
### Chat Models
@@ -412,21 +415,24 @@ oci-cis-agent/
| Cohere | Command R (08-2024) | `cohere.command-r-08-2024` | COHERE |
| Meta | Llama 4 Maverick | `meta.llama-4-maverick-17b-128e-instruct-fp8` | GENERIC |
| Meta | Llama 4 Scout | `meta.llama-4-scout-17b-16e-instruct` | GENERIC |
| Meta | Llama 3.3 (70B) | `meta.llama-3.3-70b-instruct` | GENERIC |
| Meta | Llama 3.2 90B Vision | `meta.llama-3.2-90b-vision-instruct` | GENERIC |
| Meta | Llama 3.2 11B Vision | `meta.llama-3.2-11b-vision-instruct` | GENERIC |
| Meta | Llama 3.1 (405B) | `meta.llama-3.1-405b-instruct` | GENERIC |
| Meta | Llama Guard 4 (12B) | `meta.llama-guard-4-12b` | GENERIC |
| Google | Gemini 2.5 Pro | `google.gemini-2.5-pro` | GENERIC |
| Google | Gemini 2.5 Flash | `google.gemini-2.5-flash` | GENERIC |
| Google | Gemini 2.5 Flash-Lite | `google.gemini-2.5-flash-lite` | GENERIC |
| OpenAI | GPT-5.3 Codex | `openai.gpt-5.3-codex` | GENERIC |
| OpenAI | GPT-5.2 Codex | `openai.gpt-5.2-codex` | GENERIC |
| OpenAI | GPT-5.2 Pro | `openai.gpt-5.2-pro` | GENERIC |
| OpenAI | GPT-5.2 Pro (2025-12-11) | `openai.gpt-5.2-pro-2025-12-11` | GENERIC |
| OpenAI | GPT-5.2 | `openai.gpt-5.2` | GENERIC |
| OpenAI | GPT-5.2 (2025-12-11) | `openai.gpt-5.2-2025-12-11` | GENERIC |
| OpenAI | GPT-5.2 Chat Latest | `openai.gpt-5.2-chat-latest` | GENERIC |
| OpenAI | GPT-5.2 Pro (2025-12-11) | `openai.gpt-5.2-pro-2025-12-11` | GENERIC |
| OpenAI | GPT-5.1 Codex Max | `openai.gpt-5.1-codex-max` | GENERIC |
| OpenAI | GPT-5.1 Codex | `openai.gpt-5.1-codex` | GENERIC |
| OpenAI | GPT-5.1 Codex Mini | `openai.gpt-5.1-codex-mini` | GENERIC |
| OpenAI | GPT-5.1 | `openai.gpt-5.1` | GENERIC |
| OpenAI | GPT-5.1 (2025-11-13) | `openai.gpt-5.1-2025-11-13` | GENERIC |
| OpenAI | GPT-5.1 Chat Latest | `openai.gpt-5.1-chat-latest` | GENERIC |
| OpenAI | GPT-5 Codex | `openai.gpt-5-codex` | GENERIC |
| OpenAI | GPT-5 | `openai.gpt-5` | GENERIC |
| OpenAI | GPT-5 (2025-08-07) | `openai.gpt-5-2025-08-07` | GENERIC |
| OpenAI | GPT-5 Mini | `openai.gpt-5-mini` | GENERIC |
@@ -447,6 +453,8 @@ oci-cis-agent/
| OpenAI | GPT-4o Mini Search (2025-03-11) | `openai.gpt-4o-mini-search-preview-2025-03-11` | GENERIC |
| OpenAI | GPT-4o Search Preview | `openai.gpt-4o-search-preview` | GENERIC |
| OpenAI | GPT-4o Search (2025-03-11) | `openai.gpt-4o-search-preview-2025-03-11` | GENERIC |
| OpenAI | GPT Image 1.5 | `openai.gpt-image-1.5` | GENERIC |
| OpenAI | GPT Image 1 | `openai.gpt-image-1` | GENERIC |
| OpenAI | GPT Audio | `openai.gpt-audio` | GENERIC |
| OpenAI | o4-mini | `openai.o4-mini` | GENERIC |
| OpenAI | o4-mini (2025-04-16) | `openai.o4-mini-2025-04-16` | GENERIC |
@@ -468,22 +476,25 @@ oci-cis-agent/
| xAI | Grok 3 Fast | `xai.grok-3-fast` | GENERIC |
| xAI | Grok 3 Mini Fast | `xai.grok-3-mini-fast` | GENERIC |
| xAI | Grok Code Fast 1 | `xai.grok-code-fast-1` | GENERIC |
| ProtectAI | DeBERTa Prompt Injection v2 | `protectai.deberta-v3-base-prompt-injection-v2` | GENERIC |
> **Custom OCID**: You can also use any model available in your region by selecting "Personalizado (usar OCID)" and providing the full model OCID.
### Embedding Models
| Provider | Model | Dimensions |
|----------|-------|------------|
| Cohere | Embed v4.0 (Multimodal) | 1536 |
| Cohere | Embed English v3.0 | 1024 |
| Cohere | Embed Multilingual v3.0 | 1024 |
| Cohere | Embed English Light v3.0 | 384 |
| Cohere | Embed Multilingual Light v3.0 | 384 |
| Cohere | Embed English Image v3.0 | 1024 |
| Cohere | Embed Multilingual Image v3.0 | 1024 |
| Cohere | Embed English Light Image v3.0 | 384 |
| Cohere | Embed Multilingual Light Image v3.0 | 384 |
| Provider | Model | Model ID | Dimensions |
|----------|-------|----------|------------|
| Cohere | Embed v4.0 (Multimodal) | `cohere.embed-v4.0` | 1536 |
| OpenAI | Text Embedding 3 Large | `openai.text-embedding-3-large` | 3072 |
| OpenAI | Text Embedding 3 Small | `openai.text-embedding-3-small` | 1536 |
| Cohere | Embed English v3.0 | `cohere.embed-english-v3.0` | 1024 |
| Cohere | Embed Multilingual v3.0 | `cohere.embed-multilingual-v3.0` | 1024 |
| Cohere | Embed English Light v3.0 | `cohere.embed-english-light-v3.0` | 384 |
| Cohere | Embed Multilingual Light v3.0 | `cohere.embed-multilingual-light-v3.0` | 384 |
| Cohere | Embed English Image v3.0 | `cohere.embed-english-image-v3.0` | 1024 |
| Cohere | Embed Multilingual Image v3.0 | `cohere.embed-multilingual-image-v3.0` | 1024 |
| Cohere | Embed English Light Image v3.0 | `cohere.embed-english-light-image-v3.0` | 384 |
| Cohere | Embed Multilingual Light Image v3.0 | `cohere.embed-multilingual-light-image-v3.0` | 384 |
### GenAI Regions
@@ -511,7 +522,7 @@ oci-cis-agent/
| Version | Date | Changes |
|---------|------|---------|
| **v1.4** | 2026-03 | In-place config editing (OCI, GenAI, ADB, MCP), 63 chat models (OpenAI GPT-5.2/5.1/5/4.1/4o, o1/o3/o4-mini, xAI Grok 4.1/4/3, Google Gemini 2.5, Meta Llama 4, Cohere Command A), custom OCID model support, Cohere Embed v4.0 multimodal, wallet auto-parse with DSN extraction |
| **v1.4** | 2026-03 | In-place config editing, 69 chat + 11 embedding models with OCID resolution (OpenAI GPT-5.3/5.2/5.1/5/4.1/4o/Codex/Image/Audio, xAI, Google, Meta, ProtectAI), OpenAI Text Embedding 3, custom OCID support, wallet auto-parse with DSN extraction |
| **v1.3** | 2026-03 | Persistent config logs per tab, GenAI auto-fill from OCI credentials, inline UX feedback with loading spinners, MCP type-switch fix, encrypted key passphrase support, Docker stdin hang fix |
| **v1.2** | 2026-03 | RAG pipeline (OCI GenAI embeddings + ADB vector search), dedicated Embeddings tab, CIS report chunking, file upload embedding |
| **v1.1** | 2025-02 | OCI SDK GenAI (exact pattern), OCI Account Explorer, MCP↔ADB linking, full chat parameters |