Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files26 unmodified lines2728293031323334353616 unmodified lines53545556575826 unmodified linesAPI_BASE_URL = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1")MODEL_NAME = os.getenv("OPENENV_MODEL", "gpt-4o-mini")client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY"),base_url=API_BASE_URL)async def openai_agent(observation) -> Action:"""Uses LLM to suggest a code fix."""16 unmodified lines"think": "Your chain-of-thought reasoning before patching (important!)"}}"""try:response = await client.chat.completions.create(model=MODEL_NAME,26 unmodified lines2728293031323334353637383940414243444516 unmodified lines626364656667686970717273747526 unmodified linesAPI_BASE_URL = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1")MODEL_NAME = os.getenv("OPENENV_MODEL", "gpt-4o-mini")_client = Nonedef get_openai_client():global _clientif _client is None:api_key = os.getenv("OPENAI_API_KEY")if not api_key:return None_client = AsyncOpenAI(api_key=api_key,base_url=API_BASE_URL)return _clientasync def openai_agent(observation) -> Action:"""Uses LLM to suggest a code fix."""16 unmodified lines"think": "Your chain-of-thought reasoning before patching (important!)"}}"""client = get_openai_client()if not client:return Action(patch=observation.buggy_code,task_id=observation.task_id,think="Skipping LLM call: OPENAI_API_KEY not set.")try:response = await client.chat.completions.create(model=MODEL_NAME,
baseline/run_baseline.py+21-4