https://github.com/stylepatrick/custom-data-openai-rest-api
OpenAI linked with custom data and REST API for questions
https://github.com/stylepatrick/custom-data-openai-rest-api
artificial-intelligence custom-data fastapi langchain openai rest-api
Last synced: 9 months ago
JSON representation
OpenAI linked with custom data and REST API for questions
- Host: GitHub
- URL: https://github.com/stylepatrick/custom-data-openai-rest-api
- Owner: stylepatrick
- License: mit
- Created: 2023-09-01T21:06:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-01T21:31:03.000Z (over 2 years ago)
- Last Synced: 2025-01-26T07:41:23.028Z (11 months ago)
- Topics: artificial-intelligence, custom-data, fastapi, langchain, openai, rest-api
- Language: Python
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# custom-data-openai-rest-api
OpenAI linked with custom data provided in the /data folder and REST API for questions
Installation:
`pip install langchain openai chromadb tiktoken unstructured`
### API:
POST: http://127.0.0.1:8000/question
### Examples:
Custom Data:
```
I was born in Italy on May 1996
I have two sisters and one brother
```
## Question 1:
Question:
```
{
"text": "Where was i born?"
}
```
Answer:
```
{
"text": "I was born in Italy."
}
```
## Question 2:
Question:
```
{
"text": "How much sisters do i have?"
}
```
Answer:
```
{
"text": "Based on the given information, you have two sisters."
}
```
## Question 3:
Question:
```
{
"text": "Who is Obama?"
}
```
Answer:
```
{
"text": "Barack Obama is an American politician who served as the 44th President of the United States from 2009 to 2017. He is not related to the context given."
}
```