File size: 4,168 Bytes
d195d4f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
openapi: 3.0.1
info:
title: factool
description: A plugin for fact checking. You can verify the factuality of a sentence, a paragraph, a math solution, or a code snippet.
version: 'v1'
servers:
- url: http://localhost:5003
paths:
/fact_check_kbqa:
post:
operationId: fact_check_kbqa
summary: Fact-check a given passage or a sentence on the knowledge provided.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckRequest'
responses:
'200':
description: Fact-check result
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckResponse'
/fact_check_code:
post:
operationId: fact_check_code
summary: Fact-check the correctness of code generation.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckRequest'
responses:
'200':
description: Fact-check result
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckResponse'
/fact_check_math:
post:
operationId: fact_check_math
summary: Fact-check the math calculations in mathematical reasoning.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckRequest'
responses:
'200':
description: Fact-check result
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckResponse'
/fact_check_scientific_literature:
post:
operationId: fact_check_scientific_literature
summary: Fact-check the existence of scientfic literatures mentioned in the given passage or sentence.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckRequest'
responses:
'200':
description: Fact-check result
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckResponse'
/fact_check/{fact_check_id}:
get:
operationId: get_fact_check
summary: Retrieve a previous fact check result.
parameters:
- in: path
name: fact_check_id
schema:
type: integer
required: true
description: The ID of the fact check result to retrieve.
responses:
'200':
description: Fact-check result
content:
application/json:
schema:
$ref: '#/components/schemas/FactCheckResponse'
'404':
description: Fact check not found.
components:
schemas:
FactCheckRequest:
type: object
properties:
prompt:
type: string
description: (REQUIRED) The user prompt that requested a response (i.e., the user prompt that request the ChatGPT response to be fact-checked.)
response:
type: string
description: (REQUIRED) The response to be fact-checked (usually a ChatGPT response). (VERY IMPORTANT) HOWEVER, if the user directly asks you to fact-check a knowledge-based statement, then the response should be same as the prompt.
entry_point:
type: ["string", "null"]
description: The function name of the code snippet to be fact-checked in the response. Could be "null" if the response doesn't contain any code snippet.
FactCheckResponse:
type: object
properties:
fact_check_result:
type: array
items:
type: object
description: The list of fact-check results as dictionaries. This list includes claims extracted from the response, claim-level_factuality and response-level factuality of the response, and potentially the descriptions of why each claim in the response is factual or not.
|