Documented compatible frameworks don't work out of the box
Nadie ha tomado este issue todavía.
- #11 de @fede-kamel — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- ai, authentication, backend-api-design
Línea de trabajo
Comienza revisando PR #11 y los helpers de autenticación existentes para las integraciones de LangChain, PydanticAI y OpenAI Agents SDK descritas aquí. Comprueba cómo acepta cada framework un cliente httpx personalizado y, después, verifica que los builders propuestos gestionen el encabezado OpenAI-Project y la firma OCI para los frameworks compatibles; la finalización debe coincidir con la solución alternativa documentada, sin afirmar compatibilidad con frameworks que necesiten hacks adicionales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The OCI Enterprise AI Agents documentation states:
Compatible agent frameworks include: OpenAI Agents SDK, OpenAI Codex SDK, Microsoft Agent Framework, LangChain, LangGraph, CrewAI, AutoGen, LlamaIndex, Pydantic
None of these frameworks (besides the raw OpenAI SDK) work out of the box with the /openai/v1 endpoint. Two issues compound:
1. OpenAI-Project header is mandatory but non-standard
The /openai/v1 endpoint requires an OpenAI-Project header with the GenAI Project OCID on every request. The raw OpenAI SDK supports this via project=. But ChatOpenAI (LangChain), Agent (PydanticAI), LLM (CrewAI), etc. have no project parameter. There is no way to set this header through their public API without workarounds.
2. OCI IAM signing requires custom HTTP client
OCI IAM auth requires a custom httpx.Auth handler to sign requests. Only frameworks that accept a custom http_client= parameter can use it. Frameworks that create their own HTTP clients internally (CrewAI, AutoGen) cannot.
Impact
A developer following Oracle's docs will write:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="openai.gpt-5.2",
base_url="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/openai/v1",
api_key=os.getenv("OCI_GENAI_API_KEY"),
# project=PROJECT_OCID ← doesn't exist in ChatOpenAI
)
This fails. Every other cloud provider's OpenAI-compatible endpoint (Together AI, Groq, Fireworks, Azure) works with these frameworks by just swapping base_url and api_key. OCI is the only one that requires workarounds.
Workaround
Pass a pre-configured httpx.Client with the OpenAI-Project header and OCI signing:
http_client = httpx.Client(
auth=OciUserPrincipalAuth(profile_name="DEFAULT"),
headers={"OpenAI-Project": PROJECT_OCID},
)
llm = ChatOpenAI(model=..., http_client=http_client, api_key="not-used", ...)
This works for LangChain, PydanticAI, and OpenAI Agents SDK (which accept http_client). CrewAI, AutoGen, and LlamaIndex require additional framework-specific hacks.
Proposal
Add builder functions to oci-genai-auth that encapsulate the workaround for each framework. PR #11 implements this for the frameworks that support it cleanly (LangChain, PydanticAI, OpenAI Agents SDK).
- Lenguaje dominante
- Python
- Estrellas
- 5
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de oracle-samples/oci-genai-auth-python
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de oracle-samples/oci-genai-auth-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Kludex/python-multipart#375 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 3 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 11 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
FuRongJun-1999/dsh-memory#1000 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gcivil-nyu-org/team5-mon-fall26#154 ·
Los mantenedores suelen responder en 1 día