Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

add support for Azure, OpenAI, Palm, Anthropic, Cohere Models - using litellm #408

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions automata/llm/providers/openai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import openai
from litellm import completion
import tiktoken
from termcolor import colored

Expand Down Expand Up @@ -291,15 +292,15 @@ def get_next_assistant_completion(self) -> OpenAIChatMessage:
f"Approximately {self.approximate_tokens_consumed} tokens were consumed prior to completion generation."
)
if functions:
response = openai.ChatCompletion.create(
response = completion(
model=self.model,
messages=self.conversation.get_messages_for_next_completion(),
functions=functions,
function_call="auto", # auto is default, but we'll be explicit
stream=self.stream,
)
else:
response = openai.ChatCompletion.create(
response = completion(
model=self.model,
messages=self.conversation.get_messages_for_next_completion(),
stream=self.stream,
Expand Down