Prompt di ruolo per chatbot

Prompt Engineering con l'API di OpenAI

Fouad Trad

Machine Learning Engineer

Prompt di ruolo

  • Fai interpretare al chatbot un ruolo specifico
  • Chatbot -> attore in una scena
  • Il chatbot si adatta al ruolo
  • Linguaggio e contenuti su misura per la persona
  • Interazioni più efficaci

 

Immagine con maschere e travestimenti per indicare il gioco di ruolo.

Prompt Engineering con l'API di OpenAI

Esempio di ruolo

Domanda: Puoi darmi le specifiche tecniche del Prodotto X offerto dalla tua azienda?

Immagine che mostra l'utente e tre persone, ognuna che rappresenta un ruolo (assistenza clienti, project manager e sales engineer)

Prompt Engineering con l'API di OpenAI

Esempio di ruolo

Domanda: Puoi darmi le specifiche tecniche del Prodotto X offerto dalla tua azienda?

Immagine che mostra l'utente e tre persone, ognuna che rappresenta un ruolo (assistenza clienti, project manager e sales engineer)

Prompt Engineering con l'API di OpenAI

Esempio di ruolo

Domanda: Puoi darmi le specifiche tecniche del Prodotto X offerto dalla tua azienda?

Immagine che mostra l'utente e tre persone, ognuna che rappresenta un ruolo (assistenza clienti, project manager e sales engineer)

Prompt Engineering con l'API di OpenAI

Agente di assistenza clienti

Immagine di un agente di assistenza clienti.

  • Fornisce indicazioni
  • Indirizza al sito web
  • Offre assistenza
Prompt Engineering con l'API di OpenAI

Product manager

  • Evidenzia i benefici strategici
  • Punta sull'allineamento al prodotto

Immagine di un product manager.

Prompt Engineering con l'API di OpenAI

Sales engineer

  • Focus su specifiche tecniche
    • Processore
    • Funzionalità
    • Sicurezza

Immagine di un sales engineer.

Prompt Engineering con l'API di OpenAI

Prompt di ruolo

  • Dì al modello di agire come un ruolo specifico
system_prompt = "Act as an expert financial analyst."

user_prompt = "Offer insights into retirement planning for individuals approaching retirement age." print(get_response(system_response, user_response))
Prompt Engineering con l'API di OpenAI

Analista finanziario esperto

Proper retirement planning is crucial to ensure a comfortable and financially stable retirement. Here are some key
considerations:

- Evaluate Your Financial Position: Begin by assessing your current financial situation [...]
- Set Retirement Goals: Determine your retirement goals and lifestyle preferences [...]
- Estimate Retirement Expenses: Project your retirement expenses by categorizing them into essential [...]
[...]

Remember, retirement planning is a complex process, and everyone's situation is unique. 
It's advisable to work with a certified financial planner who can provide personalized advice based on 
your individual needs and goals.
Prompt Engineering con l'API di OpenAI

Ruoli più efficaci

  • Requisiti specifici nel ruolo
  • Includi tratti come personalità ed esperienza
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your thorough research and insightful analysis."

user_prompt = "What is the impact of artificial intelligence on job markets?" print(get_response(system_response, user_response))
Prompt Engineering con l'API di OpenAI

Giornalista tech

Title: "Navigating the New Normal: How Artificial Intelligence is Reshaping Job Markets"

As the technological landscape continues to evolve at an unprecedented pace, one of the most 
significant transformations we're witnessing is the integration of Artificial Intelligence 
(AI) into various industries [...].

While AI's potential to streamline processes [...]. Let's explore the multifaceted impact 
of AI on employment...

1. Automation and Job Displacement: [...]
2. Augmentation and Enhanced Creativity: [...]
[...]

In conclusion, the impact of AI on job markets is undeniable, reshaping traditional roles 
and paving the way for novel opportunities [...]
Prompt Engineering con l'API di OpenAI

Ruoli con requisiti

  • Possiamo specificare linee guida e comportamenti nei prompt di ruolo
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your in-depth research and insightful analysis."






Prompt Engineering con l'API di OpenAI

Ruoli con requisiti

  • Possiamo specificare linee guida e comportamenti nei prompt di ruolo.
system_prompt = "Act as a seasoned technology journalist covering the latest trends 
in the tech industry. You're known for your in-depth research and insightful analysis.
If the question is related to tech, you answer to the best of your knowledge.
Otherwise, you just respond with 'I am trained to only discuss technology topics."

user_prompt = "Which American literature books do you recommend?" print(get_response(system_prompt, user_prompt))
I am trained to only discuss technology topics.
Prompt Engineering con l'API di OpenAI

Ayo berlatih!

Prompt Engineering con l'API di OpenAI

Preparing Video For Download...