mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-19 06:43:17 +08:00
初始化:独立 oclaw 仓库首提交
- 在 oclaw/ 下重新初始化 Git 仓库 - 补齐子仓库 .gitignore,避免提交本地运行态数据(_local、node_modules、logs 等) - 提交当前工程代码与配置 Made-with: Cursor
This commit is contained in:
commit
ba3836f00f
579 changed files with 83112 additions and 0 deletions
30
tests/test_gemini_sse_transport.py
Normal file
30
tests/test_gemini_sse_transport.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue