Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
π
π
π
Powered by
Hall
Inactive
Updated 10 months ago
0
Follow
How to use AzureOpenAI with function
How to use AzureOpenAI with function
Inactive
0
Follow
o
openmind
10 months ago
Β·
How to use AzureOpenAI with function calling?
Using OpenAI, it is working fine, but It is not working with AzureOpenAI
func_response = getGPT35Client(True).complete(func_prompt, tools=[relevance_fn])
def getGPT35Client(isAzure ):
client = OpenAI(model="gpt-3.5-turbo", api_key=os.environ.get('EXTOVATE_OPENAI_API_KEY'))
try:
if isAzure == True:
azureClient = AzureOpenAI(
openai_api_key=os.environ.get('MY_KEY'),
openai_api_base=os.environ.get("MY_ENDPOINT"),
openai_api_version="2023-12-01-preview",
openai_api_type="azure",
model="MyModelName"
)
return azureClient
else:
return client
except Exception as err:
print(err)
return client
m
1 comment
Share
Open in Discord
m
maybe goats dont exist
10 months ago
you need to use a newer api version 2023-12-01-preview is quite old and wont have function calling
Add a reply
Sign up and join the conversation on Discord
Join on Discord