oclaw/tests/test_gemini_sse_transport.py
oliver ba3836f00f 初始化:独立 oclaw 仓库首提交
- 在 oclaw/ 下重新初始化 Git 仓库
- 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等)
- 提交当前工程代码与配置

Made-with: Cursor
2026-04-24 22:31:22 +08:00

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}