send_message

Sending a Simple Message

To quickly send a message (e.g., for testing purposes) without extra configurations:

from zerogpt import Client

client = Client()
print(client.send_message('Hello'))

How to Define a Role for the Model in the Prompt

To guide the model to respond in a specific role, provide clear instructions in the prompt. For instance:

  1. Technical Expert: "You are an expert in cloud computing. Describe the benefits of using cloud services for small businesses."

  2. Support Agent: "You are a customer support agent. Help a customer troubleshoot a slow internet connection."

  3. Creative Writer: "You are a novelist. Write a short story about an unexpected friendship between a cat and a robot."

These instructions help the model focus on the context and role needed for the response, ensuring relevant and effective answers.

from zerogpt import Client

client = Client()
print(client.send_message(
    'Hello',
    instruction='You are a psychologist with 20 years of experience.'
))

Last updated

Was this helpful?