I am trying to build a simple streamlit app in python using azure AI. I am getting the following error which I do not know how to resolve:
InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>
Below is my code that includes the commands where I include my azure credentials:
from langchain.chat_models import ChatOpenAI
from langchain.schema import(
SystemMessage,
HumanMessage,
AIMessage
)
from langchain.llms import AzureOpenAI
import streamlit as st
from streamlit_chat import message
import os
import openai
# loading the OpenAI api key from .env (OPENAI_API_KEY="...")
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(), override=True)
openai.api_type = "azure"
openai.api_base = "https://aitraining2023.openai.azure.com/"
#openai.api_base = "https://aitraining2023.openai.azure.com/openai/deployments/AItraining2023/chat/completions?api-version=2023-03-15-preview"
openai.api_version = "2023-03-15-preview"
openai.api_key = os.getenv("OPENAI_API_KEY")
an app that accepts texts and responds