|
|
|
@ -44,16 +44,16 @@ class OpenAIFunctionCaller:
|
|
|
|
|
self.temperature = temperature
|
|
|
|
|
self.base_model = base_model
|
|
|
|
|
self.max_tokens = max_tokens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
from openai import OpenAI
|
|
|
|
|
except ImportError:
|
|
|
|
|
logger.error("OpenAI library not found. Please install the OpenAI library by running 'pip install openai'")
|
|
|
|
|
logger.error(
|
|
|
|
|
"OpenAI library not found. Please install the OpenAI library by running 'pip install openai'"
|
|
|
|
|
)
|
|
|
|
|
subprocess.run(["pip", "install", "openai"])
|
|
|
|
|
from openai import OpenAI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.client = OpenAI(api_key=api_key)
|
|
|
|
|
|
|
|
|
|
def run(self, task: str, *args, **kwargs) -> BaseModel:
|
|
|
|
|