Skip to content

Commit

Permalink
OPENAI_API_KEY gets treated specially in GH actions unfortunately. Us…
Browse files Browse the repository at this point in the history
…ing it in the chat ui isn't right anyway, fixed to be ASSISTANTS_API_KEY
  • Loading branch information
dividor committed Jul 11, 2024
1 parent e8e9739 commit b95bea3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ jobs:
#
# ssh -i <YOUR GITHUB SSH KEY> <CONN STRING ON ACTIONS>
#
- name: DEBUG - Setup upterm session
uses: lhotari/action-upterm@v1
#- name: DEBUG - Setup upterm session
# uses: lhotari/action-upterm@v1

#- name: DEBUG - Run Selenium outside of promptflow
# run: |
# docker exec promptflow python call_assistant.py

# - name: Run tests
# run: |
# env > .env
# docker exec promptflow pf run create --flow . --data ./data.jsonl --stream --column-mapping query='${data.query}' context='${data.context}' chat_history='${data.chat_history}' --name base_run
- name: Run tests
run: |
env > .env
docker exec promptflow pf run create --flow . --data ./data.jsonl --stream --column-mapping query='${data.query}' context='${data.context}' chat_history='${data.chat_history}' --name base_run
# - name: Show results
# run: |
# docker exec promptflow pf run show-details -n base_run
# echo "Getting metrics ..."
# docker exec promptflow pf run show-metrics -n base_run
# ##docker exec promptflow pf run visualize -n base_run
# echo "Checking results ..."
# docker exec promptflow python3 check_evaluation_results.py
- name: Show results
run: |
docker exec promptflow pf run show-details -n base_run
echo "Getting metrics ..."
docker exec promptflow pf run show-metrics -n base_run
##docker exec promptflow pf run visualize -n base_run
echo "Checking results ..."
docker exec promptflow python3 check_evaluation_results.py
4 changes: 2 additions & 2 deletions ui/chat-chainlit-assistant/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def setup(cl):
"""

if os.environ.get("ASSISTANTS_API_TYPE") == "openai":
async_openai_client = AsyncOpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
sync_openai_client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
async_openai_client = AsyncOpenAI(api_key=os.environ.get("ASSISTANTS_API_KEY"))
sync_openai_client = OpenAI(api_key=os.environ.get("ASSISTANTS_API_KEY"))
else:
async_openai_client = AsyncAzureOpenAI(
azure_endpoint=os.getenv("ASSISTANTS_BASE_URL"),
Expand Down

0 comments on commit b95bea3

Please sign in to comment.