#Can I use multiple system roles and different results?

7 messages · Page 1 of 1 (latest)

visual vortex
#

I want to do two things under one api call. The prompt I am using is

prompts:
  - role: system
    text: For each name separated by comma, give firstName and lastName in JSON array (make sure to trim output)
  - role: user
    text: Joe Rogan, Elon Musk, Sam Altman
  - role: system
    text: For the following description, give me top 3 industries
  - role: user
    text: |
      A highly skilled professional in the tech, development, and SaaS industries, adept at crafting cutting-edge solutions that drive business growth and innovation. With a passion for problem-solving and a keen eye for detail, this individual possesses a deep understanding of software architecture, coding languages, and cloud-based technologies. They excel in collaborating with cross-functional teams, ensuring seamless product development and delivery. With a continuous thirst for learning and staying ahead of industry trends, this tech enthusiast is an invaluable asset, delivering exceptional results in the ever-evolving world of technology.

Suppose I have these prompts, it should give me following output

choices:
  - message:
      content: '[{"firstName":"Joe","lastName":"Rogan"},{"firstName":"Elon","lastName":"Musk"},{"firstName":"Sam","lastName":"Altman"}]'
  - message:
      content: ["Technology", "SaaS", "Web Development"]

Currently I am getting only one message in the choices field.

brazen igloo
visual vortex
#

Like this?

prompts:
  - role: system
    text: You will me given comma separated names
  - role: system
    text: For each name give firstName and lastName in JSON array (make sure to trim output)
  - role: user
    text: Joe Rogan, Elon Musk, Sam 
quick lily
#

With no intent to be critical - I'm not sure why you feel a need to put these together. I'm thinking this is a matter of context : If you need people data, call one prompt, if you need categorization, call another. That is, the end-point is determined by the application. This is common API structure. It's the definition of Context - what do you want to do and what is the data you want to use for it?

For your purposes, why not just have a little conversation in the system role as follows (untested) :

You are performing two separate but clear functions.
First, if you are provided with the name of a person, return JSON as follows: ...
Second, if you are provided with a block of text that is obviously not a person's name, determine the top three industries represented by that text and return the industry names in this JSON structure: ...
If you receive any other request, a question or statement that doesn't represent a person's name or the description of an industry, respond with "I'm sorry Dave, I can't process that."

I think people here are trying to be too "computerese" at times when simply spelling out what you want in plain English tends to be the best approach. ( Occam's razor )

HTH

brazen igloo
visual vortex
#

I see, also will the system prompts be billed?

brazen igloo