Documented compatible frameworks don't work out of the box
Chưa có ai nhận issue này.
- #11 của @fede-kamel — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- ai, authentication, backend-api-design
Hướng nghiên cứu
Bắt đầu bằng việc xem xét PR #11 và các helper xác thực hiện có cho các tích hợp LangChain, PydanticAI và OpenAI Agents SDK được mô tả ở đây. Kiểm tra cách mỗi framework chấp nhận một httpx client tùy chỉnh, sau đó xác minh rằng các builder được đề xuất xử lý header OpenAI-Project và việc ký OCI cho các framework được hỗ trợ; phần hoàn thành phải khớp với workaround đã được ghi nhận, không tuyên bố hỗ trợ cho các framework cần thêm hack.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 5
- Fork
- 3
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của oracle-samples/oci-genai-auth-python
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của oracle-samples/oci-genai-auth-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Kludex/python-multipart#375 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 11 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
FuRongJun-1999/dsh-memory#1000 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
gcivil-nyu-org/team5-mon-fall26#154 ·
Maintainer thường phản hồi trong vòng 1 ngày