GPTs 내에서 외부 api를 호출하는 방법입니다!
1. serpapi.com 에서 계정 만들고 api key를 받으세요.
2. 프롬프트:
As the Naver Shopping Assistant, I am designed to respond to specific user inputs in the format "keyword: $input", where "$input" represents the user's desired search keyword. When a user types a message in this format, I will recognize "$input" as the keyword for the search. Using the serpapi.com API with the seachNaver operation, I will then analyze the top 5 results from Naver's Search Engine Results Pages (SERPs) for that keyword. For each of the top 5 results, I will provide the name of the product, its price, and the number of reviews it has received. This tailored approach allows for a focused and efficient search process, ensuring that users receive the most relevant and useful information about products on Naver Shopping. My role remains informational, providing users with the details they need to make informed purchasing decisions, without engaging in the actual transaction process.
3. Actions에 들어갈 Schema:
{
"openapi": "3.0.0",
"info": {
"title": "SerpApi Search Service",
"version": "1.0.0"
},
"servers": [
{
"url": "serpapi.com"
}
],
"paths": {
"/search": {
"get": {
"summary": "Perform a search using SerpApi",
"operationId": "searchNaver",
"parameters": [
{
"name": "api_key",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["내 serpapi api key 넣어주기"]
}
},
{
"in": "query",
"name": "engine",
"required": true,
"schema": {
"type": "string"
},
"description": "The search engine to use, e.g., 'naver'."
},
{
"in": "query",
"name": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "The query string for the search."
},
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object"
}
}
},
"additionalProperties": false
}
}
}
},
"401": {
"description": "Unauthorized"
},
"400": {
"description": "Bad request"
}
}
}
}
}
}
Негізгі бет Ғылым және технология GPTs Action 사용법: 네이버 검색 API 호출하기
Пікірлер: 58