-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up repo for streamlit and required python packages.
- Loading branch information
Showing
2 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
import streamlit as st | ||
import streamlit as st | ||
st.set_page_config(page_title="Speak-To-Docs", page_icon="📝", layout="wide", initial_sidebar_state="expanded") | ||
|
||
import os | ||
|
||
# Langchain components | ||
from langchain.chains import RetrievalQA | ||
from langchain.chat_models import ChatOpenAI | ||
|
||
# Add OpenAI library | ||
import openai | ||
|
||
# Get Configuration Settings | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
|
||
# Configure OpenAI API using Azure OpenAI | ||
openai.api_key = os.getenv("API_KEY") | ||
openai.api_base = os.getenv("ENDPOINT") | ||
openai.api_type = "azure" # Necessary for using the OpenAI library with Azure OpenAI | ||
openai.api_version = os.getenv("OPENAI_API_VERSION") # Latest / target version of the API | ||
|
||
# Implementation | ||
from langchain.embeddings import OpenAIEmbeddings | ||
|
||
# OpenAI Settings | ||
model_deployment = "text-embedding-ada-002" | ||
# SDK calls this "engine", but naming it "deployment_name" for clarity | ||
|
||
model_name = "text-embedding-ada-002" | ||
|
||
openai_embeddings: OpenAIEmbeddings = OpenAIEmbeddings( | ||
openai_api_version = os.getenv("OPENAI_API_VERSION"), openai_api_key = os.getenv("API_KEY"), | ||
openai_api_base = os.getenv("ENDPOINT"), openai_api_type = "azure" | ||
) | ||
|
||
# LLM - Azure OpenAI | ||
llm = ChatOpenAI(temperature = 0.3, openai_api_key = os.getenv("API_KEY"), openai_api_base = os.getenv("ENDPOINT"), model_name="gpt-35-turbo", engine="Voicetask") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,68 @@ | ||
aiohappyeyeballs==2.4.0 | ||
aiohttp==3.10.6 | ||
aiosignal==1.3.1 | ||
altair==5.4.1 | ||
annotated-types==0.7.0 | ||
anyio==4.6.0 | ||
attrs==24.2.0 | ||
azure-cognitiveservices-speech==1.40.0 | ||
blinker==1.8.2 | ||
cachetools==5.5.0 | ||
certifi==2024.8.30 | ||
charset-normalizer==3.3.2 | ||
click==8.1.7 | ||
frozenlist==1.4.1 | ||
gitdb==4.0.11 | ||
GitPython==3.1.43 | ||
greenlet==3.1.1 | ||
h11==0.14.0 | ||
httpcore==1.0.5 | ||
httpx==0.27.2 | ||
idna==3.10 | ||
Jinja2==3.1.4 | ||
jsonpatch==1.33 | ||
jsonpointer==3.0.0 | ||
jsonschema==4.23.0 | ||
jsonschema-specifications==2023.12.1 | ||
langchain==0.2.16 | ||
langchain-core==0.2.41 | ||
langchain-text-splitters==0.2.4 | ||
langsmith==0.1.128 | ||
markdown-it-py==3.0.0 | ||
MarkupSafe==2.1.5 | ||
mdurl==0.1.2 | ||
multidict==6.1.0 | ||
narwhals==1.8.3 | ||
numpy==2.1.1 | ||
numpy==1.26.4 | ||
openai==0.28.1 | ||
orjson==3.10.7 | ||
packaging==24.1 | ||
pandas==2.2.3 | ||
pillow==10.4.0 | ||
protobuf==5.28.2 | ||
pyarrow==17.0.0 | ||
pydantic==2.9.2 | ||
pydantic_core==2.23.4 | ||
pydeck==0.9.1 | ||
Pygments==2.18.0 | ||
python-dateutil==2.9.0.post0 | ||
python-dotenv==1.0.1 | ||
pytz==2024.2 | ||
PyYAML==6.0.2 | ||
referencing==0.35.1 | ||
requests==2.32.3 | ||
rich==13.8.1 | ||
rpds-py==0.20.0 | ||
six==1.16.0 | ||
smmap==5.0.1 | ||
sniffio==1.3.1 | ||
SQLAlchemy==2.0.35 | ||
streamlit==1.38.0 | ||
tenacity==8.5.0 | ||
toml==0.10.2 | ||
tornado==6.4.1 | ||
tqdm==4.66.5 | ||
typing_extensions==4.12.2 | ||
tzdata==2024.2 | ||
urllib3==2.2.3 | ||
yarl==1.12.1 |