Skip to content
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

OPENAI_API_KEY is not set, skipping trace export #190

Open
lonngxiang opened this issue Mar 17, 2025 · 3 comments
Open

OPENAI_API_KEY is not set, skipping trace export #190

lonngxiang opened this issue Mar 17, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@lonngxiang
Copy link

from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel, ModelSettings, handoff
from agents.extensions.handoff_prompt import prompt_with_handoff_instructions
import asyncio
import json
from pydantic import BaseModel, ValidationError

# 设置OpenAI客户端
openai_client = AsyncOpenAI(base_url="https://api.deepseek.com", api_key="sk-******")

Image

@lonngxiang lonngxiang added the bug Something isn't working label Mar 17, 2025
@WSQsGithub
Copy link

You need to export env var explicly in your terminal using export OPEN_API_KEY=sk-xxxx or use load_env() to do that.
It seems like agents-sdk doesn't have an interface like openai sdk.

@Salaudev
Copy link

Salaudev commented Mar 17, 2025

@lonngxiang

if you want to use an external LLM, you need to disable tracing

Image

@EnggQasim
Copy link

from agents import set_tracing_disabled
set_tracing_disabled(disabled=True)

Just apply this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants