-
Notifications
You must be signed in to change notification settings - Fork 677
fix: stabilize failing ElevenLabs, HuggingFace, and Sarvam tests #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ | |
|
|
||
| SARVAM_BASE_URL = "https://api.sarvam.ai/v1" | ||
| DEFAULT_MODEL = "sarvam-m" | ||
| SUPPORTED_MODELS = {"sarvam-m", "sarvam-30b", "sarvam-105b"} | ||
| SUPPORTED_MODELS = {"sarvam-m", "sarvam-105b"} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 4 '\bSUPPORTED_MODELS\b|sarvam-30b' .Repository: GetStream/Vision-Agents Length of output: 5457 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- candidate files ---'
fd -t f 'llm\.py$|test.*sarvam|sarvam.*test' . | head -80
printf '%s\n' '--- Sarvam LLM structure ---'
ast-grep outline plugins/sarvam/vision_agents/plugins/sarvam/llm.py
printf '%s\n' '--- Sarvam LLM implementation ---'
cat -n plugins/sarvam/vision_agents/plugins/sarvam/llm.py | sed -n '1,180p'
printf '%s\n' '--- LLM class and constructor usages ---'
rg -n -C 5 'class LLM|def __init__|model not in|SUPPORTED_MODELS|Sarvam LLM|sarvam-30b' \
plugins/sarvam . -g '*.py' | head -300Repository: GetStream/Vision-Agents Length of output: 31989 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- base ChatCompletionsLLM constructor ---'
rg -n -C 12 'class ChatCompletionsLLM|def __init__' \
plugins/openai/vision_agents/plugins/openai agents-core/vision_agents/core/llm/llm.py -g '*.py' | head -240
printf '%s\n' '--- Sarvam LLM tests ---'
cat -n plugins/sarvam/tests/test_sarvam_llm.py | sed -n '1,150p'
printf '%s\n' '--- AST validation probe ---'
python3 - <<'PY'
import ast
from pathlib import Path
sarvam_path = Path("plugins/sarvam/vision_agents/plugins/sarvam/llm.py")
source = sarvam_path.read_text()
tree = ast.parse(source)
class InitVisitor(ast.NodeVisitor):
def __init__(self):
self.init = None
def visit_FunctionDef(self, node):
if node.name == "__init__":
self.init = node
self.generic_visit(node)
visitor = InitVisitor()
visitor.visit(tree)
init = visitor.init
print("SarvamLLM.__init__ contains SUPPORTED_MODELS:", any(
isinstance(node, ast.Name) and node.id == "SUPPORTED_MODELS"
for node in ast.walk(init)
))
print("SarvamLLM.__init__ model comparisons:", [
ast.unparse(node) for node in ast.walk(init)
if isinstance(node, ast.Compare)
])
base_candidates = list(Path("plugins/openai").rglob("*.py"))
for path in base_candidates:
text = path.read_text()
if "class ChatCompletionsLLM" not in text:
continue
base_tree = ast.parse(text)
for node in ast.walk(base_tree):
if isinstance(node, ast.ClassDef) and node.name == "ChatCompletionsLLM":
inits = [
item for item in node.body
if isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef))
and item.name == "__init__"
]
if inits:
base_init = inits[0]
print("Base constructor:", path)
print("Base constructor model comparisons:", [
ast.unparse(item) for item in ast.walk(base_init)
if isinstance(item, ast.Compare)
])
print("Base constructor model assignments:", [
ast.unparse(item) for item in ast.walk(base_init)
if isinstance(item, ast.Assign)
and "model" in ast.unparse(item)
])
PYRepository: GetStream/Vision-Agents Length of output: 27706 Reject unsupported Sarvam models at construction.
|
||
|
|
||
| _THINK_RE = re.compile(r"<think>.*?</think>", re.DOTALL) | ||
|
|
||
|
|
@@ -97,7 +97,7 @@ class SarvamLLM(ChatCompletionsLLM): | |
| Examples: | ||
|
|
||
| from vision_agents.plugins import sarvam | ||
| llm = sarvam.LLM(model="sarvam-30b") | ||
| llm = sarvam.LLM(model="sarvam-105b") | ||
| """ | ||
|
|
||
| provider_name = "sarvam" | ||
|
|
@@ -113,7 +113,7 @@ def __init__( | |
|
|
||
| Args: | ||
| model: The Sarvam model id. Defaults to ``sarvam-m``. Supported: | ||
| ``sarvam-m``, ``sarvam-30b``, ``sarvam-105b``. | ||
| ``sarvam-m``, ``sarvam-105b``. | ||
| api_key: Sarvam API key. Defaults to ``SARVAM_API_KEY`` env var. | ||
| base_url: API base URL. Defaults to ``https://api.sarvam.ai/v1``. | ||
| client: Optional pre-configured ``AsyncOpenAI`` client. Takes | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.