Skip to content

Commit

Permalink
reconocimiento de voz finalizado. desarrollando sistema de respuesta
Browse files Browse the repository at this point in the history
  • Loading branch information
ofesquiro committed Aug 8, 2024
1 parent f19badb commit 5c5c378
Show file tree
Hide file tree
Showing 2,795 changed files with 109 additions and 8,893,818 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/model
/ouijaEnv
File renamed without changes.
28 changes: 28 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import openai
import os
import pandas as pd
import time
#from dotenv import load_dotenv

key = "sk-None-QNt9k3yPvnphhkW0R1skT3BlbkFJr0S52c5LiHtpfC6TdNIz"
client = openai.Client(api_key=key)

def get_chat_response(prompt : str, model: str = "text-babbage-001") -> None:
messages : list[dict[str, str]] = [{"role": "user", "content": prompt}]
response : any = client.chat.completions.create(
model=model,
messages=messages,
temperature=0,
max_tokens=100
)
for chunk in response:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")

def main ():
prompt = "What is the capital of France?"
get_chat_response(prompt)
main()



Loading

0 comments on commit 5c5c378

Please sign in to comment.