File tree Expand file tree Collapse file tree
src/ContentProcessor/src/libs/pipeline/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from agent_framework import Content , Message
1818from pdf2image import convert_from_bytes
1919
20- from libs .agent_framework .agent_builder import AgentBuilder
20+ from libs .agent_framework .agent_builder import AgentBuilder , _is_reasoning_model , _resolve_model_name
2121from libs .agent_framework .agent_framework_helper import AgentFrameworkHelper
2222from libs .agent_framework .azure_openai_response_retry import ContextTrimConfig
2323from libs .application .application_context import AppContext
@@ -255,12 +255,19 @@ async def execute(self, context: MessageContext) -> StepResult:
255255 .build ()
256256 )
257257
258+ # logprobs is not supported by reasoning models (o1, o3, gpt-5.x)
259+ model_name = _resolve_model_name (agent_client )
260+ if model_name and _is_reasoning_model (model_name ):
261+ run_options = {}
262+ else :
263+ run_options = {"logprobs" : True , "top_logprobs" : 5 }
264+
258265 gpt_response = await agent .run (
259266 messages = Message (
260267 "user" ,
261268 contents = self ._to_agent_framework_contents (user_content ),
262269 ),
263- options = { "logprobs" : True , "top_logprobs" : 5 } ,
270+ options = run_options ,
264271 )
265272
266273 response_content = gpt_response .text # Json format string
You can’t perform that action at this time.
0 commit comments