mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 05:50:44 +08:00
- 在 oclaw/ 下重新初始化 Git 仓库 - 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等) - 提交当前工程代码与配置 Made-with: Cursor
30 lines
958 B
Python
30 lines
958 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from oclaw.platform.llm.transports.google_gemini_sse import GoogleGeminiChatModel
|
|
|
|
|
|
def test_gemini_tool_decl_uses_parameters_json_schema() -> None:
|
|
m = GoogleGeminiChatModel(model="gemini-3.1-pro", api_key="x", base_url="http://gw")
|
|
decls = m._tool_decls_from_openai_tools(
|
|
[
|
|
{
|
|
"type": "function",
|
|
"function": {
|
|
"name": "query_route",
|
|
"description": "d",
|
|
"parameters": {"type": "object", "properties": {"destination": {"type": "string"}}},
|
|
},
|
|
}
|
|
]
|
|
)
|
|
assert decls and "parametersJsonSchema" in decls[0]
|
|
assert "parameters" not in decls[0]
|
|
|
|
|
|
def test_gemini_thinking_config_env_off() -> None:
|
|
os.environ["AIA_GEMINI_THINKING"] = "off"
|
|
cfg = GoogleGeminiChatModel._thinking_config_from_env()
|
|
assert cfg == {"includeThoughts": False}
|
|
|