mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
Add Sarvam LLM, update Sarvam STT models, expose usage_info on run detail (#351)
* Add Sarvam LLM provider, update Sarvam STT models, expose usage_info on run detail. Depends on pipecat PR dograh-hq/pipecat#43 for STT string language support. Submodule bump will follow after that merges. * test: cover Sarvam STT language mapping; link Sarvam docs --------- Co-authored-by: Sabiha Khan <sabihak89@gmail.com>
This commit is contained in:
parent
13b30dee9e
commit
98d2b24cba
10 changed files with 272 additions and 9 deletions
23
api/tests/test_run_usage_response.py
Normal file
23
api/tests/test_run_usage_response.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
from api.services.pricing.run_usage_response import format_public_usage_info
|
||||
|
||||
|
||||
def test_format_public_usage_info():
|
||||
usage_info = {
|
||||
"llm": {
|
||||
"SarvamLLMService#0|||sarvam-30b": {
|
||||
"prompt_tokens": 100,
|
||||
"completion_tokens": 50,
|
||||
"total_tokens": 150,
|
||||
}
|
||||
},
|
||||
"tts": {"ElevenLabsTTSService#0|||eleven_flash_v2_5": 42},
|
||||
"stt": {},
|
||||
"call_duration_seconds": 12.4,
|
||||
}
|
||||
|
||||
result = format_public_usage_info(usage_info)
|
||||
|
||||
assert result["llm"]["SarvamLLMService#0|||sarvam-30b"]["prompt_tokens"] == 100
|
||||
assert result["tts"]["ElevenLabsTTSService#0|||eleven_flash_v2_5"] == 42
|
||||
assert result["stt"] == {}
|
||||
assert result["call_duration_seconds"] == 12.4
|
||||
Loading…
Add table
Add a link
Reference in a new issue