remove pyq goodbye model and rime synthesizer and fix environment loading
This commit is contained in:
parent
a93bfc1ec9
commit
1dc7bc74c3
28 changed files with 143 additions and 285 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import os
|
||||
import random
|
||||
import time
|
||||
from langchain.prompts import (
|
||||
|
|
@ -16,23 +15,20 @@ import openai
|
|||
import json
|
||||
from typing import Generator, Optional
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from typing import Generator
|
||||
import logging
|
||||
from vocode import getenv
|
||||
|
||||
from vocode.streaming.agent.base_agent import BaseAgent
|
||||
from vocode.streaming.models.agent import ChatGPTAgentConfig
|
||||
from vocode.streaming.utils.sse_client import SSEClient
|
||||
from vocode.streaming.agent.utils import stream_llm_response
|
||||
|
||||
load_dotenv()
|
||||
|
||||
openai.api_key = os.environ.get("OPENAI_API_KEY")
|
||||
|
||||
|
||||
class ChatGPTAgent(BaseAgent):
|
||||
def __init__(self, agent_config: ChatGPTAgentConfig, logger: logging.Logger = None):
|
||||
super().__init__(agent_config)
|
||||
openai.api_key = getenv("OPENAI_API_KEY")
|
||||
self.agent_config = agent_config
|
||||
self.logger = logger or logging.getLogger(__name__)
|
||||
self.logger.setLevel(logging.DEBUG)
|
||||
|
|
@ -112,7 +108,7 @@ class ChatGPTAgent(BaseAgent):
|
|||
"https://api.openai.com/v1/chat/completions",
|
||||
headers={
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {os.environ.get('OPENAI_API_KEY')}",
|
||||
"Authorization": f"Bearer {getenv('OPENAI_API_KEY')}",
|
||||
},
|
||||
json={
|
||||
"model": self.agent_config.model_name,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import re
|
||||
from typing import Optional
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from langchain import OpenAI
|
||||
from langchain.llms import OpenAIChat
|
||||
from typing import Generator
|
||||
|
|
@ -11,8 +10,6 @@ from vocode.streaming.agent.base_agent import BaseAgent
|
|||
from vocode.streaming.agent.utils import stream_llm_response
|
||||
from vocode.streaming.models.agent import LLMAgentConfig
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class LLMAgent(BaseAgent):
|
||||
SENTENCE_ENDINGS = [".", "!", "?"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue