ScratchGPT / main.py
Space-Face's picture
Update main.py
271c54a verified
raw
history blame
477 Bytes
import SpaceFace as sf
import GPTSimple as ai
class AIEndpoint:
def receivedMessage(self, message, user: sf.User, responder: sf.Responder):
if hasattr(user, 'chat'):
responder.respond(user.chat.ask(message))
else:
chat = ai.conversation(base_url="deepinfra", model="meta-llama/Llama-3.2-90B-Vision-Instruct")
responder.respond(user.chat.ask(message))
responder.close()
sf.start_server([AIEndpoint()])