import pytesseract | |
import google.generativeai as genai | |
api_key = 'AIzaSyB7-RzBwTAfVA-7ZGk2mEOQwOxshpwzhpM' # put your API key here | |
genai.configure(api_key=api_key) | |
geminiModel = genai.GenerativeModel(model_name='gemini-pro') | |
def llm(img): | |
text = pytesseract.image_to_string(img, lang='vie') | |
# generate text | |
prompt = "take this peace of information and give all the information in point wise better format also give some recomendation related to them' " + text | |
# print(prompt) | |
response = model.generate_content(prompt) | |
return response.text |