Skip to content
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

Update __init__.py #134

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions council/llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _build_llm(llm_config: LLMConfigObject) -> LLMBase:
return AzureLLM.from_config(llm_config)
elif provider.is_of_kind(LLMProviders.OpenAI):
return OpenAILLM.from_config(llm_config)
elif provider.is_of_kind(LLMProviders.OpenAI):
return OpenAILLM.from_config(llm_config)
elif provider.is_of_kind(LLMProviders.Anthropic):
return AnthropicLLM.from_config(llm_config)

raise ValueError(f"Provider `{provider.kind}` not supported by Council")
8 changes: 8 additions & 0 deletions tests/unit/llm/test_llm_config_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def test_openai_from_yaml():
assert llm.config.temperature.value == 0.5
assert llm.config.n.value == 3

llm = get_llm_from_config(filename)
assert isinstance(llm, OpenAILLM)


def test_azure_from_yaml():
filename = get_data_filename(LLModels.Azure)
Expand All @@ -28,6 +31,8 @@ def test_azure_from_yaml():

llm = AzureLLM.from_config(actual)
assert isinstance(llm, AzureLLM)
llm = get_llm_from_config(filename)
assert isinstance(llm, AzureLLM)


def test_anthropic_from_yaml():
Expand All @@ -39,6 +44,9 @@ def test_anthropic_from_yaml():
assert isinstance(llm, AnthropicLLM)
assert llm.config.top_k.value == 8

llm = get_llm_from_config(filename)
assert isinstance(llm, AnthropicLLM)


def test_azure_with_openai_fallback_from_yaml():
filename = get_data_filename(LLModels.AzureWithFallback)
Expand Down
Loading