-
Notifications
You must be signed in to change notification settings - Fork 183
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
Azure OpenAI crashes without non-Azure API key #509
Comments
Hey @mtakemoto! This error is from the See the note here regarding this behavior. In your case, you can provide the AzureOpenAiEmbeddingDriver like this: import os
from griptape.structures import Agent
from griptape.drivers import AzureOpenAiChatPromptDriver, AzureOpenAiEmbeddingDriver
agent = Agent(
prompt_driver=AzureOpenAiChatPromptDriver(
api_key=os.environ["AZURE_OPENAI_API_KEY_1"],
model="gpt-3.5-turbo-16k",
azure_deployment=os.environ["AZURE_OPENAI_35_16k_DEPLOYMENT_ID"],
azure_endpoint=os.environ["AZURE_OPENAI_API_BASE_1"],
),
embedding_driver=AzureOpenAiEmbeddingDriver(
api_key=os.environ["AZURE_OPENAI_API_KEY_1"],
model="text-embedding-ada-002",
azure_deployment=os.environ["AZURE_OPENAI_35_16k_DEPLOYMENT_ID"],
azure_endpoint=os.environ["AZURE_OPENAI_API_BASE_1"],
),
) |
Hey @mtakemoto just checking in to see whether this has resolved your issue. Thanks! |
Hey @collindutter thanks for the reply here showing me how to override the embedding driver! However, I'd like to propose that the
More broadly, I'd like to propose that any cloud-based AI provider automatically initialize with their own embedding endpoint unless explicitly overridden (e.g. wanting to mix HuggingFace models with an OpenAI embedding provider). Thanks again and please let me know what your thoughts are! |
Thank you for the well thought out suggestion, and totally agree with your points! The topic of defaults is something we are actively working on in #242; we should have a proper solution in the coming weeks. The Prompt Driver will likely still remain decoupled from the Embedding Driver, but there will be a new construct to tie them together. |
We've gotten this issue a handful of times over the last few weeks, I am going to keep this issue open as the source of discussion. |
closed by #242 |
Describe the bug
After configuring the AzureOpenAiChatPromptDriver, it won't start without also setting the "OPENAI_API_KEY" environment variable. This is a bit deceptive since (in theory) Azure OpenAI should support everything that the 1st party offering does.
To Reproduce
Steps to reproduce the behavior:
api_key
,model
,azure_deployment
andazure_endpoint
Expected behavior
The embedding driver should use the Azure endpoint for embeddings and not have a dependency on environment variable
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
The WebScraper also has a hard dependency on the OpenAI tokenizer. Falls into the same category of making the library more flexible but probably worth opening a separate isue
The text was updated successfully, but these errors were encountered: