Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Nov 22, 2024
1 parent 65fa9dc commit 7034596
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/export_and_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,29 @@ jobs:
import openai
import os
openai.api_key = os.getenv("OPENAI_API_KEY")
api_key = os.getenv("OPENAI_API_KEY")
vector_store_id = os.getenv("VECTOR_STORE_ID")
client = OpenAI(api_key) # Replace with your actual 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="fine-tune" # or "search", depending on your vector store requirements
response = client.files.create(
file=open("/content/merged_documentation.md", "rb"),
purpose="assistants"
)
file_id = response["id"]
print("File uploaded successfully with ID:", file_id)
# Optionally associate the file with a vector store
if vector_store_id:
print(f"Associating file {file_id} with vector store {vector_store_id}...")
# Replace this block with the appropriate call to link file to vector store
# For example, use the OpenAI API or custom API for your vector store
# Example:
# response = some_vector_store_api.add_file_to_vector_store(file_id, vector_store_id)
print("File successfully associated.")
client.beta.vector_stores.files.create(
vector_store_id=vector_store_id,
file_id=file.id
)
EOF

0 comments on commit 7034596

Please sign in to comment.