@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
66 lines (57 loc) • 2.19 kB
YAML
description: Test language detection accuracy for various text inputs
providers:
- openai:chat:gpt-5-mini
- openai:chat:claude-3-5-haiku-latest
- openai:chat:gemini-flash-latest
- openai:chat:deepseek-chat
prompts:
- file://promptfoo/language-detection/prompt.ts
tests:
- vars:
content: "Hello, how are you today? I hope you're having a great day!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for English (e.g., en-US, en-GB, en)"
- type: contains-any
value: ["en-", "en"]
- vars:
content: "Bonjour, comment allez-vous? J'espère que vous passez une excellente journée!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for French (e.g., fr-FR, fr-CA, fr)"
- type: contains-any
value: ["fr-", "fr"]
- vars:
content: "你好,你今天怎么样?希望你过得愉快!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for Chinese (e.g., zh-CN, zh-TW, zh)"
- type: contains-any
value: ["zh-", "zh"]
- vars:
content: "Hola, ¿cómo estás hoy? ¡Espero que tengas un gran día!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for Spanish (e.g., es-ES, es-MX, es)"
- type: contains-any
value: ["es-", "es"]
- vars:
content: "Привет, как дела сегодня? Надеюсь, у тебя отличный день!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for Russian (e.g., ru-RU, ru)"
- type: contains-any
value: ["ru-", "ru"]
- vars:
content: "こんにちは、今日はいかがですか?素晴らしい一日をお過ごしください!"
assert:
- type: llm-rubric
provider: openai:gpt-5-mini
value: "Should output a valid locale code for Japanese (e.g., ja-JP, ja)"
- type: contains-any
value: ["ja-", "ja"]