Fix fail llama test (#2819)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled

* Changed test case

* Addd new interaction with llama

* fixed linting issue

* Gemma Flaky test case

* Gemma Flaky test case

* Minor change

* Minor change

* Dropped API key

* Removed falky test case check file
This commit is contained in:
Vidit Ostwal
2025-05-17 00:48:11 +05:30
committed by GitHub
parent 0b35e40a24
commit aa6e5b703e
2 changed files with 44 additions and 6137 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,4 @@
import json
import os
from typing import Dict, List, Optional
from unittest.mock import MagicMock, Mock, patch
@@ -19,6 +18,8 @@ from crewai.utilities.converter import (
validate_model,
)
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
# Tests for enums
from enum import Enum
@pytest.fixture(scope="module")
@@ -359,7 +360,7 @@ def test_convert_with_instructions():
@pytest.mark.vcr(filter_headers=["authorization"])
def test_converter_with_llama3_2_model():
llm = LLM(model="ollama/llama3.2:3b", base_url="http://localhost:11434")
llm = LLM(model="openrouter/meta-llama/llama-3.2-3b-instruct")
sample_text = "Name: Alice Llama, Age: 30"
instructions = get_conversion_instructions(SimpleModel, llm)
converter = Converter(
@@ -431,7 +432,7 @@ def test_converter_error_handling():
)
with pytest.raises(ConverterError) as exc_info:
output = converter.to_pydantic()
converter.to_pydantic()
assert "Failed to convert text into a Pydantic model" in str(exc_info.value)
@@ -515,10 +516,6 @@ def test_converter_with_list_field():
assert output.items == [1, 2, 3]
# Tests for enums
from enum import Enum
def test_converter_with_enum():
class Color(Enum):
RED = "red"
@@ -565,7 +562,7 @@ def test_converter_with_ambiguous_input():
)
with pytest.raises(ConverterError) as exc_info:
output = converter.to_pydantic()
converter.to_pydantic()
assert "failed to convert text into a pydantic model" in str(exc_info.value).lower()