refac: audio

This commit is contained in:
Timothy J. Baek 2024-04-20 15:15:59 -05:00
parent 2a10438b4d
commit 710850e442
7 changed files with 133 additions and 9 deletions

View file

@ -324,11 +324,11 @@ def get_embedding_model_path(
def generate_openai_embeddings(
model: str, text: str, key: str, url: str = "https://api.openai.com"
model: str, text: str, key: str, url: str = "https://api.openai.com/v1"
):
try:
r = requests.post(
f"{url}/v1/embeddings",
f"{url}/embeddings",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {key}",