Logo

Convert Query To Search Term

Given a user query, convert this into a querystring for SERPAPI or any browser tool.

Information

ID: 14035178-278a-45ce-b2c2-7bced3b6bbf1

Referenced Content: 0

Artifact: No

Tags: #public#systemprompt

Payload

{
  "message": "Find a present for my 10 year old nephew, he loves cars. "
}

Response

{
  "structured_data": {
    "region": "US",
    "language": "en",
    "queryString": "best car toys for 10 year old boy Christmas 2023"
  },
  "conversation": {
    "title": "Finding the Perfect Toy Car for a Car-Loving Nephew",
    "description": "A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift."
  }
}

Prompt Data

Input Schema

Input Type: message

This schema outlines instructions for generating a search query as Santa Claus to find an ideal Christmas gift. It includes guidelines for understanding user information, utilizing it to craft meaningful queries, and maintaining a festive tone. The goal is to leverage user data like age, interests, and preferences to form effective search terms that identify suitable gift ideas online, embodied by the spirit of Santa.

{
  "name": "Input Schema",
  "strict": true,
  "description": "Sample input schema",
  "input_schema": {
    "type": "object",
    "properties": [],
    "additionalProperties": false
  }
}

Output Schema

Output type: structured_data

This schema outlines instructions for generating a search query as Santa Claus to find an ideal Christmas gift. It includes guidelines for understanding user information, utilizing it to craft meaningful queries, and maintaining a festive tone. The goal is to leverage user data like age, interests, and preferences to form effective search terms that identify suitable gift ideas online, embodied by the spirit of Santa.

{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "required": [
    "queryString",
    "language",
    "region"
  ],
  "properties": {
    "region": {
      "type": "string",
      "description": "The regional setting for the search, specified as a country code."
    },
    "language": {
      "type": "string",
      "description": "The language in which the search results are desired."
    },
    "queryString": {
      "type": "string",
      "description": "The main text of the search query."
    }
  },
  "additionalProperties": false
}

Instructions

Static

1. Assume the role of an AI agent who understands the needs and desires of individuals from the information provided.
2. Receive detailed information about a user, which can include age, interests, hobbies, recent activities, preferences, and any known wishlist items.
3. Use this information to craft a Google search query that would help find a Christmas present suitable for the user. 
4. The search query should be concise but include key terms likely to yield relevant and desirable gift options.
5. Consider various types of presents such as toys, gadgets, experiences, fashion items, or books, based on the user's information.
6. Be adaptable to unusual or sparse user information, utilizing common gift-giving trends when specific details are lacking. 

State

{{ conversation.history }}

Dynamic

{{ message }}

Generation

Curl request

curl -X POST "https://api.systemprompt.io/v1/prompt/14035178-278a-45ce-b2c2-7bced3b6bbf1" \
  -H "api-key: {API-KEY}" \
  -H "Content-Type: application/json" \
  -d '{"message":"Find a present for my 10 year old nephew, he loves cars. "}'

Response

{
  "success": true,
  "data": {
    "static": "1. Assume the role of an AI agent who understands the needs and desires of individuals from the information provided.\r\n2. Receive detailed information about a user, which can include age, interests, hobbies, recent activities, preferences, and any known wishlist items.\r\n3. Use this information to craft a Google search query that would help find a Christmas present suitable for the user. \r\n4. The search query should be concise but include key terms likely to yield relevant and desirable gift options.\r\n5. Consider various types of presents such as toys, gadgets, experiences, fashion items, or books, based on the user's information.\r\n6. Be adaptable to unusual or sparse user information, utilizing common gift-giving trends when specific details are lacking. ",
    "dynamic": "<message>Find a present for my 10 year old nephew, he loves cars. </message>",
    "state": "",
    "output_schema": {
      "type": "object",
      "properties": {
        "structured_data": {
          "type": "object",
          "$schema": "http://json-schema.org/draft-07/schema#",
          "required": [
            "queryString",
            "language",
            "region"
          ],
          "properties": {
            "region": {
              "type": "string",
              "description": "The regional setting for the search, specified as a country code."
            },
            "language": {
              "type": "string",
              "description": "The language in which the search results are desired."
            },
            "queryString": {
              "type": "string",
              "description": "The main text of the search query."
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "structured_data"
      ],
      "additionalProperties": false
    },
    "parsed_tokens": [
      "message"
    ],
    "token_counts": {
      "static": 148,
      "dynamic": 20
    },
    "prompt": {
      "id": "14035178-278a-45ce-b2c2-7bced3b6bbf1",
      "instruction": {
        "static": "1. Assume the role of an AI agent who understands the needs and desires of individuals from the information provided.\r\n2. Receive detailed information about a user, which can include age, interests, hobbies, recent activities, preferences, and any known wishlist items.\r\n3. Use this information to craft a Google search query that would help find a Christmas present suitable for the user. \r\n4. The search query should be concise but include key terms likely to yield relevant and desirable gift options.\r\n5. Consider various types of presents such as toys, gadgets, experiences, fashion items, or books, based on the user's information.\r\n6. Be adaptable to unusual or sparse user information, utilizing common gift-giving trends when specific details are lacking. ",
        "dynamic": "{{ message }}",
        "state": "{{ conversation.history }}"
      },
      "input": {
        "name": "SantaGiftQuerySchema",
        "description": "This schema outlines instructions for generating a search query as Santa Claus to find an ideal Christmas gift. It includes guidelines for understanding user information, utilizing it to craft meaningful queries, and maintaining a festive tone. The goal is to leverage user data like age, interests, and preferences to form effective search terms that identify suitable gift ideas online, embodied by the spirit of Santa.",
        "schema": {
          "name": "Input Schema",
          "strict": true,
          "description": "Sample input schema",
          "input_schema": {
            "type": "object",
            "properties": [],
            "additionalProperties": false
          }
        },
        "type": [
          "message"
        ],
        "reference": []
      },
      "output": {
        "name": "SantaGiftQuerySchema",
        "description": "This schema outlines instructions for generating a search query as Santa Claus to find an ideal Christmas gift. It includes guidelines for understanding user information, utilizing it to craft meaningful queries, and maintaining a festive tone. The goal is to leverage user data like age, interests, and preferences to form effective search terms that identify suitable gift ideas online, embodied by the spirit of Santa.",
        "schema": {
          "type": "object",
          "$schema": "http://json-schema.org/draft-07/schema#",
          "required": [
            "queryString",
            "language",
            "region"
          ],
          "properties": {
            "region": {
              "type": "string",
              "description": "The regional setting for the search, specified as a country code."
            },
            "language": {
              "type": "string",
              "description": "The language in which the search results are desired."
            },
            "queryString": {
              "type": "string",
              "description": "The main text of the search query."
            }
          },
          "additionalProperties": false
        },
        "type": [
          "structured_data"
        ],
        "reference": []
      },
      "metadata": {
        "title": "ConvertQueryToSearchTerm",
        "description": "Given a user query, convert this into a querystring for SERPAPI or any browser tool.",
        "created": "2024-11-22T10:38:07+01:00",
        "updated": "2024-12-05T13:21:47+01:00",
        "version": 29299,
        "status": "published",
        "tag": [
          "public",
          "systemprompt"
        ]
      },
      "_link": "/v1/prompt/14035178-278a-45ce-b2c2-7bced3b6bbf1"
    }
  },
  "warnings": []
}

Execution

Curl request

curl -X POST "https://api.systemprompt.io/v1/prompt/14035178-278a-45ce-b2c2-7bced3b6bbf1/openai" \
  -H "api-key: {API-KEY}" \
  -H "Content-Type: application/json" \
  -d '{"message":"Find a present for my 10 year old nephew, he loves cars. "}'

Response

{
  "data": {
    "message": {
      "id": "28626e42-b9c0-4ec4-9531-4dbfdd73b5a1",
      "role": "assistant",
      "model": "gpt-4o-2024-08-06",
      "content": "{\"structured_data\":{\"region\":\"US\",\"language\":\"en\",\"queryString\":\"best car toys for 10 year old boy Christmas 2023\"},\"conversation\":{\"title\":\"Finding the Perfect Toy Car for a Car-Loving Nephew\",\"description\":\"A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift.\"}}",
      "metadata": {
        "tag": [],
        "title": "Finding the Perfect Toy Car for a Car-Loving Nephew",
        "author": "gpt-4o-2024-08-06",
        "status": "published",
        "created": "2024-12-05T13:21:36+01:00",
        "updated": "2024-12-05T13:21:30+01:00",
        "version": 29298,
        "description": "A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift."
      },
      "reference": []
    },
    "conversation": {
      "id": "c4e5efef-a5ff-44d4-9aa7-e61cc894e7de",
      "type": "conversation",
      "_link": "/v1/conversation/c4e5efef-a5ff-44d4-9aa7-e61cc894e7de",
      "message": [
        {
          "id": "fc7898ae-74cb-4999-882e-c46a2089bbdd",
          "role": "user",
          "model": "gpt-4o-2024-08-06",
          "content": "Find a present for my 10 year old nephew, he loves cars. ",
          "metadata": {
            "tag": [],
            "title": "Gift Ideas for Car-Loving Nephew",
            "author": "9NbDgfbyE1CICkmq3yjU",
            "status": "published",
            "created": "2024-12-05T13:21:32+01:00",
            "updated": "2024-12-05T13:21:30+01:00",
            "version": 29297,
            "description": "The user is seeking gift recommendations for their 10-year-old nephew who has a passion for cars."
          },
          "reference": [
            {
              "id": "14035178-278a-45ce-b2c2-7bced3b6bbf1",
              "type": "prompt",
              "_link": "/v1/prompt/14035178-278a-45ce-b2c2-7bced3b6bbf1"
            }
          ]
        },
        {
          "id": "28626e42-b9c0-4ec4-9531-4dbfdd73b5a1",
          "role": "assistant",
          "model": "gpt-4o-2024-08-06",
          "content": "{\"structured_data\":{\"region\":\"US\",\"language\":\"en\",\"queryString\":\"best car toys for 10 year old boy Christmas 2023\"},\"conversation\":{\"title\":\"Finding the Perfect Toy Car for a Car-Loving Nephew\",\"description\":\"A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift.\"}}",
          "metadata": {
            "tag": [],
            "title": "Finding the Perfect Toy Car for a Car-Loving Nephew",
            "author": "9NbDgfbyE1CICkmq3yjU",
            "status": "published",
            "created": "2024-12-05T13:21:36+01:00",
            "updated": "2024-12-05T13:21:30+01:00",
            "version": 29298,
            "description": "A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift."
          },
          "reference": [
            {
              "id": "14035178-278a-45ce-b2c2-7bced3b6bbf1",
              "type": "prompt",
              "_link": "/v1/prompt/14035178-278a-45ce-b2c2-7bced3b6bbf1"
            }
          ]
        }
      ],
      "metadata": {
        "tag": [
          "ai_generated"
        ],
        "title": "Gift Ideas for Car-Loving Nephew",
        "status": "published",
        "created": "2024-12-05T13:21:30+01:00",
        "updated": "2024-12-05T13:21:30+01:00",
        "version": 29296,
        "description": "The user is seeking gift recommendations for their 10-year-old nephew who has a passion for cars."
      }
    },
    "structured_data": {
      "region": "US",
      "language": "en",
      "queryString": "best car toys for 10 year old boy Christmas 2023"
    }
  },
  "success": true,
  "metadata": {
    "id": "chatcmpl-Ab59JupXCvIjEyFAFXmGdXBnwAsF3",
    "model": "gpt-4o-2024-08-06",
    "usage": {
      "total_tokens": 478,
      "prompt_tokens": 388,
      "completion_tokens": 90
    },
    "object": "chat.completion",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "{\"structured_data\":{\"region\":\"US\",\"language\":\"en\",\"queryString\":\"best car toys for 10 year old boy Christmas 2023\"},\"conversation\":{\"title\":\"Finding the Perfect Toy Car for a Car-Loving Nephew\",\"description\":\"A Google search query crafted to find Christmas presents for a 10-year-old boy who loves cars. The search focuses on top car toys available in 2023, ensuring a fun and exciting gift.\"}}"
        },
        "finish_reason": "stop"
      }
    ],
    "created": 1733401293,
    "system_fingerprint": "fp_7f6be3efb0"
  }
}

Use prompt

You can add this prompt to your dashboard by clicking the button below. (systemprompt.io subscription required).

To create a systemprompt subscripton go to the console

On this page