Gemini API helper

Gemini API helper · GPT 작업

Gemini API Interaction

This OpenAPI specification defines the interaction with the Gemini API on Google Cloud's Vertex AI platform for generating content using multimodal prompts.

  • POST /v1beta/models/gemini-pro:generateContentGenerates content using the Gemini model
원본 API 스키마
{
  "openapi": "3.0.1",
  "info": {
    "title": "Gemini API Interaction",
    "description": "This OpenAPI specification defines the interaction with the Gemini API on Google Cloud's Vertex AI platform for generating content using multimodal prompts.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://generativelanguage.googleapis.com"
    }
  ],
  "paths": {
    "/v1beta/models/gemini-pro:generateContent": {
      "post": {
        "operationId": "geminiProGenerateContent",
        "summary": "Generates content using the Gemini model",
        "parameters": [
          {
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "AIzaSyCGPxR5egyMO6g-3oTTmXT_Vw8VFnchQgQ"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateContentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateContentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateContentError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GenerateContentRequest": {
        "type": "object",
        "required": [
          "contents",
          "generation_config"
        ],
        "properties": {
          "contents": {
            "type": "array",
            "description": "An array of content parts for the model to process.",
            "items": {
              "type": "object",
              "required": [
                "role",
                "parts"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "model"
                  ],
                  "description": "The role in a conversation associated with the content."
                },
                "parts": {
                  "type": "array",
                  "description": "Ordered parts that make up the input.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "description": "Text instructions or dialogue."
                      }
                    }
                  }
                }
              }
            }
          },
          "generation_config": {
            "type": "object",
            "properties": {
              "maxOutputTokens": {
                "type": "integer",
                "description": "Maximum number of tokens that can be generated in the response."
              },
              "temperature": {
                "type": "number",
                "format": "double",
                "description": "Controls the degree of randomness in token selection."
              },
              "topP": {
                "type": "number",
                "format": "double",
                "description": "Top-P changes how the model selects tokens for output."
              },
              "topK": {
                "type": "integer",
                "description": "Top-K changes how the model selects tokens for output. The value must be greater than 1"
              }
            }
          }
        }
      },
      "GenerateContentResponse": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "description": "An array of generated content candidates.",
            "items": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "object",
                  "properties": {
                    "parts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string",
                            "description": "Generated text content."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "GenerateContentError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        }
      }
    }
  }
}

webPilot

Information Gathering with 'webPageReader': I search the internet and gather relevant information based on the writing task. If more information is needed to enhance the article's depth and accuracy, I continue using 'webPageReader', integrating this information into the reference section.

  • POST /api/readvisit web page
원본 API 스키마
{
  "openapi": "3.0.1",
  "info": {
    "title": "webPilot",
    "description": "Information Gathering with 'webPageReader': I search the internet and gather relevant information based on the writing task. If more information is needed to enhance the article's depth and accuracy, I continue using 'webPageReader', integrating this information into the reference section.",
    "version": "v1.1"
  },
  "servers": [
    {
      "url": "https://gpts.webpilot.ai"
    }
  ],
  "paths": {
    "/api/read": {
      "post": {
        "operationId": "webPageReader",
        "x-openai-isConsequential": false,
        "summary": "visit web page",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/visitWebPageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/visitWebPageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/visitWebPageError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "visitWebPageResponse": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The title of this web page"
          },
          "content": {
            "type": "string",
            "description": "The content of the web page's url to be summarized"
          },
          "meta": {
            "type": "object",
            "description": "The Html meta info of the web page"
          },
          "links": {
            "type": "array",
            "description": "Some links in the web page",
            "items": {
              "type": "string"
            }
          },
          "extra_search_results": {
            "type": "array",
            "description": "Additional Search results",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "description": "the title of this search result"
                },
                "link": {
                  "type": "string",
                  "description": "the link of this search result"
                },
                "snippet": {
                  "type": "string",
                  "description": "the snippet of this search result"
                }
              }
            }
          },
          "todo": {
            "type": "array",
            "description": "what to do with the content",
            "items": {
              "type": "string"
            }
          },
          "tips": {
            "type": "array",
            "description": "Tips placed at the end of the answer",
            "items": {
              "type": "string"
            }
          },
          "rules": {
            "description": "Adherence is required when outputting content.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "visitWebPageRequest": {
        "type": "object",
        "required": [
          "link",
          "ur"
        ],
        "properties": {
          "link": {
            "type": "string",
            "description": "Required, The web page's url to visit and retrieve content from."
          },
          "ur": {
            "type": "string",
            "description": "Required, a clear statement of the user's request, can be used as a search query and may include search operators."
          },
          "lp": {
            "type": "boolean",
            "description": "Required, Whether the link is directly provided by the user"
          },
          "rt": {
            "type": "boolean",
            "description": "If the last request doesn't meet user's need, set this to true when trying to retry another request."
          },
          "l": {
            "type": "string",
            "description": "Required, the language used by the user in the request, according to the ISO 639-1 standard. For Chinese, use zh-CN for Simplified Chinese and zh-TW for Traditional Chinese."
          }
        }
      },
      "visitWebPageError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "error code"
          },
          "message": {
            "type": "string",
            "description": "error message"
          },
          "detail": {
            "type": "string",
            "description": "error detail"
          }
        }
      }
    }
  }
}