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

Add support for Azure, llama2, palm, claude2, cohere command nightly (etc) #74

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"python-dotenv>=1.0.0",
"orjson>=3.9.0",
"rich>=13.4.1",
"litellm>=0.1.400",
"python-dateutil>=2.8.2",
],
)
13 changes: 6 additions & 7 deletions simpleaichat/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from .models import ChatMessage, ChatSession
from .utils import remove_a_key
from litellm import completion

tool_prompt = """From the list of tools below:
- Reply ONLY with the number of the tool appropriate in response to the user's last message.
Expand Down Expand Up @@ -100,14 +101,12 @@ def gen(
prompt, system, params, False, input_schema, output_schema
)

r = client.post(
str(self.api_url),
json=data,
headers=headers,
timeout=None,
# API Keys can be set in .env or passed to litellm
# eg. if using .env set os.environ['OPENAI_API_KEY']
r = completion(
**data,
api_key=self.auth['api_key'].get_secret_value()
)
r = r.json()

try:
if not output_schema:
content = r["choices"][0]["message"]["content"]
Expand Down