Skip to content

Commit

Permalink
added dockerignore files
Browse files Browse the repository at this point in the history
  • Loading branch information
denniszielke committed Jun 6, 2024
1 parent 2653b4b commit 37827fa
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ __pycache__/
# C extensions
*.so

src-agents/solphase*/**

# Distribution / packaging
.Python
build/
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ curl -X 'POST' \
"correlationToken": "1234567890"
}'
curl -X 'POST' \
"$URL/ask" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"question": "Which of the options below is a correct genre for the movie The Smoorgh Crusade? Action, Drama, Comedy, Adventure",
"type": "multiple_choice",
"correlationToken": "1234567890"
}'
```

## Deploy resources for Phase 1
Expand Down
3 changes: 3 additions & 0 deletions src-agents/phase1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
__pycache__
*.ipynb
3 changes: 3 additions & 0 deletions src-agents/phase2/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
__pycache__
*.ipynb
11 changes: 11 additions & 0 deletions src-agents/phase2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from azure.search.documents import SearchClient
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.models import (
VectorizedQuery
)
from langchain_openai import AzureOpenAIEmbeddings

app = FastAPI()

Expand Down Expand Up @@ -61,6 +65,13 @@ class Answer(BaseModel):
credential
)

# use an embeddingsmodel to create embeddings
embeddings_model = AzureOpenAIEmbeddings(
azure_deployment = os.getenv("AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME"),
openai_api_version = os.getenv("OPENAI_EMBEDDING_API_VERSION"),
model= os.getenv("AZURE_OPENAI_EMBEDDING_MODEL")
)

@app.get("/")
async def root():
return {"message": "Hello Smorgs"}
Expand Down
136 changes: 64 additions & 72 deletions src-agents/phase2/movies.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src-agents/phase3/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
__pycache__
*.ipynb
4 changes: 4 additions & 0 deletions src-agents/phase3/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import os
import json
import requests
from dotenv import load_dotenv
from fastapi import FastAPI
from pydantic import BaseModel
from enum import Enum
from openai import AzureOpenAI
from azure.identity import DefaultAzureCredential, get_bearer_token_provider

app = FastAPI()

Expand Down Expand Up @@ -45,6 +48,7 @@ class Answer(BaseModel):
deployment_name = os.getenv("AZURE_OPENAI_COMPLETION_DEPLOYMENT_NAME")
index_name = "movies-semantic-index"
service_endpoint = os.getenv("AZURE_AI_SEARCH_ENDPOINT")
model_name = os.getenv("AZURE_OPENAI_COMPLETION_MODEL")

@app.get("/")
async def root():
Expand Down
3 changes: 3 additions & 0 deletions src-agents/phase4/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
__pycache__
*.ipynb
3 changes: 3 additions & 0 deletions src-agents/phase5/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
__pycache__
*.ipynb

0 comments on commit 37827fa

Please sign in to comment.