-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reconocimiento de voz finalizado. desarrollando sistema de respuesta
- Loading branch information
Showing
2,795 changed files
with
109 additions
and
8,893,818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/model | ||
/ouijaEnv |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
||
|
||
|
Oops, something went wrong.