Open Shivanandroy opened 1 month ago
In app.py:-
Change
from openai import AsyncAssistantEventHandler, AsyncOpenAI, OpenAI
to
from openai import AsyncAssistantEventHandler, AsyncAzureOpenAI, AzureOpenAI
async_openai_client = AsyncOpenAI(api_key=os.environ.get("OPENAI_API_KEY")) sync_openai_client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
async_openai_client = AsyncAzureOpenAI( azure_endpoint=os.getenv("OPENAI_API_BASE"), api_key=os.getenv("OPENAI_API_KEY"), api_version=os.getenv("OPENAI_API_VERSION"), ) sync_openai_client = AzureOpenAI( azure_endpoint=os.getenv("OPENAI_API_BASE"), api_key=os.getenv("OPENAI_API_KEY"), api_version=os.getenv("OPENAI_API_VERSION"), )
In .env, change to:-
OPENAI_API_TYPE="azure" OPENAI_API_VERSION="2024-05-01-preview" OPENAI_API_BASE="https://[NAME_OF_INSTANCE].openai.azure.com/" OPENAI_API_KEY="[AZURE_OPENAI_KEY"
Under requirements.txt:-
openai==1.33.0 chainlit
Worth noting:- it looks like the code interrupter is working, but I am not able to get the visualisations working as shown below:-
P.S:- I am not one of the contributor to this project.
Ended up forking the repo and implemented step-by-step instructions here:- https://github.com/samaea/azure-openai-assistant-with-chainlit.
In app.py:-
Change
from openai import AsyncAssistantEventHandler, AsyncOpenAI, OpenAI
to
from openai import AsyncAssistantEventHandler, AsyncAzureOpenAI, AzureOpenAI
Change
to
In .env, change to:-
Under requirements.txt:-
Worth noting:- it looks like the code interrupter is working, but I am not able to get the visualisations working as shown below:-
P.S:- I am not one of the contributor to this project.