From 352cc4291cb7005276a664bf68b139bc9dc99971 Mon Sep 17 00:00:00 2001 From: Luke Marsden Date: Mon, 11 Nov 2024 11:08:20 +0000 Subject: [PATCH] add default (unmodified) api prompt templates --- aispecs/exchangerates.yaml | 92 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/aispecs/exchangerates.yaml b/aispecs/exchangerates.yaml index dc1fc96..fc0db3c 100644 --- a/aispecs/exchangerates.yaml +++ b/aispecs/exchangerates.yaml @@ -79,3 +79,95 @@ spec: CAD: type: number example: 1.34521 + + request_prep_template: | + Your output must be a valid json, without any commentary or additional formatting. + + Examples: + + **User Input:** Get project prj_1234 details + **OpenAPI schema path:** /projects/{projectId} + **Verdict:** response should be + + ```json + { + "projectId": "prj_1234" + } + ``` + + **User Input:** What job is Marcus applying for? + **OpenAPI schema path:** /jobvacancies/v1/list + **OpenAPI schema parameters:** [ + { + "in": "query", + "name": "candidate_name", + "schema": { + "type": "string" + }, + "required": false, + "description": "Filter vacancies by candidate name" + } + ] + **Verdict:** response should be: + + ```json + { + "candidate_name": "Marcus" + } + ``` + + **User Input:** List all users with status "active" + **OpenAPI schema path:** /users/findByStatus + **OpenAPI schema parameters:** [ + { + "name": "status", + "in": "query", + "description": "Status values that need to be considered for filter", + "required": true, + "type": "array", + "items": { + "type": "string", + "enum": ["active", "pending", "sold"], + "default": "active" + } + } + ] + **Verdict:** response should be: + + ```json + { + "status": "active" + } + ``` + + **Response Format:** Always respond with JSON without any commentary, wrapped in markdown json tags, for example: + ```json + { + "parameterName": "parameterValue", + "parameterName2": "parameterValue2" + } + ``` + + ===END EXAMPLES=== + + OpenAPI schema: + + {{.Schema}} + + ===END OPENAPI SCHEMA=== + + Based on conversation below, construct a valid JSON object. In cases where user input does not contain information for a query, DO NOT add that specific query parameter to the output. If a user doesn't provide a required parameter, use sensible defaults for required params, and leave optional params out. Do not pass parameters as null, instead just don't include them. + ONLY use search parameters from the user messages below - do NOT use search parameters provided in the examples. + + response_success_template: | + Present the key information in a concise manner and perform any actions requested by the user. + Include relevant details, references, and links if present. Format the summary in Markdown for clarity and readability where appropriate, but don't mention formatting in your response unless it's relevant to the user's query. + Make sure to NEVER mention technical terms like "APIs, JSON, Request, etc..." and use first person pronoun (say it as if you performed the action) + + Issues and tasks mean the same thing. + IMPORTANT: If the user asks you to write code, you MUST write code. Start by describing the task described in the issue, and then write the code to perform the task. + + response_error_template: | + As an AI chat assistant, your job is to help the user understand and resolve API error messages. + When offering solutions, You will clarify without going into unnecessary detail. You must respond in less than 100 words. + You should commence by saying "An error occurred while trying to process your request ..." also, if you think it's auth error, ask the user to read this doc https://docs.helix.ml/helix/develop/helix-tools/ (format as markdown)