feat: 新增 LLM checker 支持大模型服务应用层拨测
基于 AI SDK v6 实现 openai/openai-responses/anthropic 三类 provider 的 http/stream 模式调用 支持 output/finishReason/usage/stream 等完整 expect 断言链路 新增 9 个源文件和 5 个测试文件共 78 个测试 更新 README/DEVELOPMENT/probes.example.yaml 和 probe-config.schema.json
This commit is contained in:
@@ -228,3 +228,41 @@ targets:
|
||||
payload: "<14>health check"
|
||||
expect:
|
||||
responded: false
|
||||
|
||||
- id: "llm-openai-probe"
|
||||
name: "OpenAI Chat Completions 健康检查"
|
||||
type: llm
|
||||
group: "AI 服务"
|
||||
llm:
|
||||
provider: openai
|
||||
url: "https://api.openai.com/v1"
|
||||
model: "gpt-4o-mini"
|
||||
prompt: "Say OK"
|
||||
key: "${OPENAI_API_KEY}"
|
||||
expect:
|
||||
status:
|
||||
- 200
|
||||
finishReason: "stop"
|
||||
output:
|
||||
- contains: "OK"
|
||||
|
||||
- id: "llm-anthropic-stream-probe"
|
||||
name: "Anthropic 流式健康检查"
|
||||
type: llm
|
||||
group: "AI 服务"
|
||||
llm:
|
||||
provider: anthropic
|
||||
url: "https://api.anthropic.com/v1"
|
||||
model: "claude-3-5-haiku-20241022"
|
||||
prompt: "Say OK"
|
||||
key: "${ANTHROPIC_API_KEY}"
|
||||
mode: stream
|
||||
expect:
|
||||
status:
|
||||
- 200
|
||||
stream:
|
||||
completed: true
|
||||
firstTokenMs:
|
||||
lte: 5000
|
||||
finishReason: "stop"
|
||||
maxDurationMs: 15000
|
||||
|
||||
Reference in New Issue
Block a user