Skip to content
Snippets Groups Projects
Commit c341b542 authored by Ryan Melvin's avatar Ryan Melvin
Browse files

use azure api

parent 9f593a34
No related branches found
No related tags found
1 merge request!3Feature/azure2
......@@ -3,7 +3,7 @@
import streamlit as st
from langchain.vectorstores import FAISS
from langchain.embeddings import OpenAIEmbeddings
from langchain.chat_models import ChatOpenAI
from langchain.chat_models import AzureChatOpenAI
from langchain.prompts import (
ChatPromptTemplate,
SystemMessagePromptTemplate,
......@@ -72,7 +72,7 @@ st.markdown("""
Brought to you by the Anesthesiology MPOG Steering Committee, Informatics, and Data Science teams
_Not affiliated with MPOG. Uses external resources. Not approved for use with PHI or sensitive data._
_Not affiliated with MPOG. Not approved for use with PHI._
All submissions are recorded for potential review by the MPOG Steering Committee.
......@@ -89,7 +89,14 @@ You can trick generative AIs into saying whatever you want. If you succeed in tr
As always, use your best judgment. An AI can do the wrong thing at the worst time.
""")
chat = ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo")
chat = AzureChatOpenAI(
openai_api_base="https://nlp-openai-svc.openai.azure.com",
openai_api_version="2023-03-15-preview",
deployment_name="ChatGPT35Turbo",
openai_api_key=OPENAI_API_KEY,
openai_api_type = "azure",
temperature=0
)
# Load vectorstore
embedding = OpenAIEmbeddings()
vectordb = FAISS.load_local("faiss_index", embedding)
......
......@@ -19,7 +19,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
# Check if repo has been updated since last build
ADD "https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai/commits?per_page=1" latest_commit
RUN rm -rf latest_commit
RUN git clone https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git .
RUN git clone -b feature/azure2 https://gitlab.rc.uab.edu/anes_ai/mpog-helper-openai.git .
#COPY .streamlit/secrets.toml /deploy/.streamlit/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment