Skip to content
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

chore: migrated examples to latest SDK #134

Merged
merged 8 commits into from
Aug 6, 2024
2 changes: 1 addition & 1 deletion examples/echo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aidial-sdk>=0.2
aidial-sdk>=0.10
2 changes: 1 addition & 1 deletion examples/image_size/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
aidial-sdk>=0.2
aidial-sdk>=0.10
pillow==10.3.0
aiohttp==3.9.4
8 changes: 5 additions & 3 deletions examples/langchain_rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ async def chat_completion(
model=EMBEDDINGS_MODEL,
azure_deployment=EMBEDDINGS_MODEL,
azure_endpoint=DIAL_URL,
openai_api_key=request.api_key,
# Header propagation automatically propagates the API key from the request headers.
openai_api_key="-",
openai_api_version=API_VERSION,
# The check leads to tokenization of the input strings.
# Tokenized input is only supported by OpenAI embedding models.
Expand All @@ -118,7 +119,8 @@ async def chat_completion(
llm = AzureChatOpenAI(
azure_deployment=CHAT_MODEL,
azure_endpoint=DIAL_URL,
openai_api_key=request.api_key,
# Header propagation automatically propagates the API key from the request headers.
openai_api_key="-",
openai_api_version=API_VERSION,
temperature=0,
streaming=True,
Expand All @@ -138,7 +140,7 @@ async def chat_completion(
docsearch.delete_collection()


app = DIALApp(DIAL_URL, propagation_auth_headers=True)
app = DIALApp(DIAL_URL, propagate_auth_headers=True)
app.add_chat_completion("simple-rag", SimpleRAGApplication())


Expand Down
18 changes: 9 additions & 9 deletions examples/langchain_rag/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
aidial-sdk>=0.8
langchain==0.2.5
langchain-community==0.2.9
langchain-openai==0.1.8
langchain-text-splitters==0.2.1
aidial-sdk>=0.10
langchain==0.2.9
langchain-community==0.2.7
langchain-openai==0.1.17
langchain-text-splitters==0.2.2
tiktoken==0.7.0
openai==1.34
beautifulsoup4==4.12.2
chromadb==0.5.0
openai==1.35.15
beautifulsoup4==4.12.3
chromadb==0.5.4
uvicorn==0.30.1
pypdf==4.2.0
pypdf==4.3.0
2 changes: 1 addition & 1 deletion examples/render_text/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
aidial-sdk>=0.2
aidial-sdk>=0.10
pillow==10.3.0
aiohttp==3.9.4