fixed conflict

This commit is contained in:
spikey 2024-02-24 17:04:32 -05:00
commit 0647edf54a
3 changed files with 34 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
venv
api_key

28
data.py Executable file
View File

@ -0,0 +1,28 @@
from PIL import Image
from openai import OpenAI
import pytesseract as OCR
import os
OCR.pytesseract.tesseract_cmd = r"/usr/local/bin/tesseract"
client = OpenAI(
api_key = os.environ.get("OPENAI_API_KEY"),
)
def app():
# data shit --> where does it come from???
data = OCR.image_to_string("input.png")
print(data)
complete = client.chat.completions.create(
model="gpt-3.5-turbo",
messages = [
{
"role": "user",
"content": "parse the following data in JSON format: ${data}",
}
])
print(complete.choices[0].message.content)
app()

5
start.sh Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
export OPENAI_API_KEY="$(cat api_key)"
python3 main.py