both call and generate

Former-commit-id: e69f467d51
pull/47/head
Kye 1 year ago
parent ee9f33657f
commit 00837056cf

@ -17,6 +17,12 @@ class OpenAI:
params=params,
save_messages=save_messages)
def __call__(self, message, **kwargs):
try:
return self.ai(message, **kwargs)
except Exception as error:
print(f"Error in OpenAI, {error}")
def generate(self, message, **kwargs):
try:
return self.ai(message, **kwargs)
@ -30,6 +36,6 @@ class OpenAI:
#usage
#from swarms import OpenAI()
#chat = OpenAI()
#response = chat("Hello World")
#response = chat.generate("Hello World")
#print(response)

Loading…
Cancel
Save