File tree Expand file tree Collapse file tree 4 files changed +206
-150
lines changed Expand file tree Collapse file tree 4 files changed +206
-150
lines changed Original file line number Diff line number Diff line change 5151 - " 3.11"
5252 - " 3.12"
5353 - " 3.13"
54- # TODO: enable this https://github.com/openai/openai-agents-python/pull/1961/
55- # - "3.14"
54+ - " 3.14"
5655 env :
5756 OPENAI_API_KEY : fake-for-tests
5857 steps :
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ requires-python = ">=3.9"
77license = " MIT"
88authors = [{ name = " OpenAI" , email = " support@openai.com" }]
99dependencies = [
10- " openai>=2.2 ,<3" ,
11- " pydantic>=2.10 , <3" ,
10+ " openai>=2.6.1 ,<3" ,
11+ " pydantic>=2.12.3 , <3" ,
1212 " griffe>=1.5.6, <2" ,
1313 " typing-extensions>=4.12.2, <5" ,
1414 " requests>=2.0, <3" ,
@@ -24,6 +24,7 @@ classifiers = [
2424 " Programming Language :: Python :: 3.11" ,
2525 " Programming Language :: Python :: 3.12" ,
2626 " Programming Language :: Python :: 3.13" ,
27+ " Programming Language :: Python :: 3.14" ,
2728 " Operating System :: OS Independent" ,
2829 " Topic :: Software Development :: Libraries :: Python Modules" ,
2930 " License :: OSI Approved :: MIT License" ,
Original file line number Diff line number Diff line change @@ -720,7 +720,19 @@ def run_sync(
720720 conversation_id = kwargs .get ("conversation_id" )
721721 session = kwargs .get ("session" )
722722
723- return asyncio .get_event_loop ().run_until_complete (
723+ # Python 3.14 no longer creates a default loop implicitly, so we inspect the running loop.
724+ try :
725+ loop = asyncio .get_running_loop ()
726+ except RuntimeError :
727+ loop = None
728+
729+ if loop is not None :
730+ # This method is only expected to run when no loop is already active.
731+ raise RuntimeError (
732+ "AgentRunner.run_sync() cannot be called when an event loop is already running."
733+ )
734+
735+ return asyncio .run (
724736 self .run (
725737 starting_agent ,
726738 input ,
You can’t perform that action at this time.
0 commit comments