Skip to content

Commit

Permalink
Update terminal_assistant.py
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster-exit-1 authored Feb 25, 2024
1 parent 976e515 commit 6dd5058
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions terminal_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def check_for_config():
check_for_config()

openai.api_base = "http://localhost:1234/v1"
openai.api_key = "YOUR_API_KEY_HERE"
openai.api_key = " "
API_KEY = config['AUTH']['googleapi_key']
SEARCH_ENGINE_ID = config['AUTH']['googleapi_search_id']
ENDPOINT = "https://www.googleapis.com/customsearch/v1"
Expand All @@ -65,16 +65,12 @@ def ask_gpt(prompt, model="local-model"):
"""
Function to interact with the GPT model.
"""
response = openai.ChatCompletion.create(
model="local-model",
messages=[
{"role": "system", "content": "I am your helpful assistant"},
{"role": "user", "content": prompt}
],

response = openai.Completion.create(
engine=model,
prompt=prompt,
temperature=0.7,
)
return response.choices[0].message['content']
return response.choices[0].text.strip()


def generate_speech(text):
Expand Down

0 comments on commit 6dd5058

Please sign in to comment.