app to load image documents search for cnpj using gemini and output the cnpj in structured json
To upload files, please first save the app
import streamlit as st
from gemini import extract_cnpj_from_image
st.title('CNPJ Image Document Search')
uploaded_file = st.file_uploader('Choose an image...', type=['jpg', 'png', 'jpeg'])
if uploaded_file is not None:
# Extract CNPJ from the uploaded image
cnpj = extract_cnpj_from_image(uploaded_file)
if cnpj:
st.success('CNPJ extracted successfully!')
st.json({'CNPJ': cnpj})
else:
st.error('No CNPJ found in the image.')
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?