This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.3", | |
"info": { | |
"version": "v2", | |
"title": "CircleCI API", | |
"description": "This describes the resources that make up the CircleCI API v2.\n\n# Authentication\n\n<!-- ReDoc-Inject: <security-definitions> -->", | |
"license": { | |
"name": "MIT" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleResponseErrors = (status: number, errorText: string) => { | |
if (status === 403 && errorText.toLowerCase().includes("recaptcha")) { | |
return "There was a verification error, please refresh the page and try asking your question again. If the issue persists please contact support."; | |
} else if (status === 429 && errorText.includes("User")) { | |
return "Question limit reached, please wait a few minutes and try again."; | |
} else if (status === 429 && errorText.includes("Global")) { | |
return "System capacity reached, please wait a few minutes and try again."; | |
} else if ([400, 403, 404, 429].includes(status)) { | |
return "Configuration issue detected, contact support if unresolved shortly."; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
const App = () => { | |
const [relevantSources, setRelevantSources] = useState([]); | |
const [answer, setAnswer] = useState(''); | |
const [identifiers, setIdentifiers] = useState(null); | |
const [error, setError] = useState(null); | |
const [feedback, setFeedback] = useState(null); | |
const process_stream = async (response) => { |