Skip to content

Commit

Permalink
updated file path
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Nov 22, 2024
1 parent 6f9b585 commit 28c2cda
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/export_and_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,26 @@ jobs:
VECTOR_STORE_ID: ${{ secrets.VECTOR_STORE_ID }}
run: |
python - <<EOF
import openai
from openai import OpenAI
import os
api_key = os.getenv("OPENAI_API_KEY")
vector_store_id = os.getenv("VECTOR_STORE_ID")
openai.api_key = api_key
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY")
)
# Read the consolidated markdown file
with open("merged_documentation.md", "r") as file:
content = file.read()
# Upload the consolidated file to the OpenAI vector store
response = openai.File.create(
file=open("merged_documentation.md", "rb"),
purpose="assistants"
response = openAI.files.create(
file=open("merged_documentation.md", "rb"),
purpose="assistants"
)
print(response)
file_id = response["id"]
print("File uploaded successfully with ID:", file_id)
# Optionally associate the file with a vector store
if vector_store_id:
openai.vector_stores.files.create(
vector_store_id=vector_store_id,
file_id=file.id
)
EOF

0 comments on commit 28c2cda

Please sign in to comment.