fix(llm): unify JSON output handling across providers and fix tool+json_output compatibility

- Remove redundant `response_format` injection for VOLCANO provider since it's unsupported; rely on system prompt injection instead
- Extend system prompt JSON injection logic to cover VOLCANO and tool-enabled cases universally
- Simplify model parameter construction by removing redundant `params["model_kwargs"] = model_kwargs` assignments
- Refactor `CompatibleChatOpenAI._get_request_payload` to strip `response_format` when tools are present, avoiding strict validation errors in langchain_openai
- Fix timestamp calculation order in `datetime_tool.py` to avoid integer truncation before multiplication
This commit is contained in:
Timebomb2018
2026-04-17 14:19:40 +08:00
parent 52f7ea7456
commit 377ddd2b9b
5 changed files with 51 additions and 26 deletions

View File

@@ -253,9 +253,9 @@ class DateTimeTool(BuiltinTool):
return {
"datetime": input_value,
"timezone": timezone_str,
"timestamp": int(dt.timestamp()) * 1000,
"timestamp": int(dt.timestamp() * 1000),
"iso_format": dt.isoformat(),
"result_data": int(dt.timestamp()) * 1000
"result_data": int(dt.timestamp() * 1000)
}
def _calculate_datetime(self, kwargs) -> dict: