Skip to content

Instantly share code, notes, and snippets.

@numpde
Created March 15, 2024 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numpde/23311ceacb35feefd0103226a693e1e8 to your computer and use it in GitHub Desktop.
Save numpde/23311ceacb35feefd0103226a693e1e8 to your computer and use it in GitHub Desktop.
ChatGPT Custom Action Server for Web Crawling
openapi: 3.0.3
info:
title: ChatGPT Custom Action Server for Web Crawling
description: This server enhances ChatGPT with real-time web crawling functionalities.
version: "1.0.0"
servers:
- url: https://crawler.counter-resistance.org/
paths:
/api/view/md/:
post:
summary: Convert fetched web content to Markdown
operationId: viewAsMarkdown
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSchema'
responses:
"200":
description: Content successfully converted to Markdown.
content:
application/json:
schema:
$ref: '#/components/schemas/ContentSchema'
"400":
description: Bad Request. Failed to fetch URL content or invalid input.
"401":
description: Unauthorized. Invalid API key.
security:
- ApiKeyAuth: []
/api/view/md/gpt/:
post:
summary: Process fetched content through GPT model and convert to Markdown
operationId: viewAsSimplifiedMarkdown
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSchema'
responses:
"200":
description: Content successfully processed and converted to Markdown.
content:
application/json:
schema:
$ref: '#/components/schemas/GptContentSchema'
"400":
description: Bad Request. Failed to fetch URL content or invalid input.
"401":
description: Unauthorized. Invalid API key.
security:
- ApiKeyAuth: []
/api/view/plain/:
post:
summary: Fetch web content and return as plain text
operationId: viewAsPlainText
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlSchema'
responses:
"200":
description: Content successfully fetched and returned as plain text.
content:
application/json:
schema:
$ref: '#/components/schemas/ContentSchema'
"400":
description: Bad Request. Failed to fetch URL content or invalid input.
"401":
description: Unauthorized. Invalid API key.
security:
- ApiKeyAuth: []
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-KEYS
schemas:
UrlSchema:
type: object
properties:
url:
type: string
format: uri
description: The URL to fetch and convert to Markdown.
ContentSchema:
type: object
properties:
content:
type: string
description: The fetched or processed content.
GptContentSchema:
type: object
properties:
content:
type: string
description: GPT-processed content in Markdown format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment