-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add support for Ollama, Palm, Claude-2, Cohere, Replicate Llama2 CodeLlama (100+LLMs) - using LiteLLM #53
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
from typing import Any, Dict | ||
|
||
import openai | ||
import litellm | ||
import tiktoken | ||
|
||
from camel.typing import ModelType | ||
|
@@ -66,7 +67,7 @@ def run(self, *args, **kwargs) -> Dict[str, Any]: | |
num_max_token = num_max_token_map[self.model_type.value] | ||
num_max_completion_tokens = num_max_token - num_prompt_tokens | ||
self.model_config_dict['max_tokens'] = num_max_completion_tokens | ||
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. we also expose a util called |
||
response = openai.ChatCompletion.create(*args, **kwargs, | ||
response = litellm.completion(*args, **kwargs, | ||
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. When testing this for Claude, line 78 below ("if not isinstance(response, Dict)") fails because the response is an instance of ModelResponse. Similar thing happening in chat_agent.py line 192. |
||
model=self.model_type.value, | ||
**self.model_config_dict) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this import isn't used anymore it seems