Spaces:
Sleeping
Sleeping
| from langchain_core.prompts import ChatPromptTemplate | |
| from src.config.llm import llm_2_0 as llm | |
| prompt = ChatPromptTemplate( | |
| [ | |
| { | |
| "role": "system", | |
| "content": """You are expert in invoice extraction. | |
| You are a teacher of {domain}. | |
| You are given an image in a lesson about {topic}. | |
| Explain and answer the user question. | |
| User question: {question} | |
| """, | |
| }, | |
| { | |
| "role": "user", | |
| "content": [ | |
| { | |
| "type": "image_url", | |
| "image_url": { | |
| "url": "data:image/jpeg;base64,{base64_image}", | |
| "detail": "auto", | |
| }, | |
| }, | |
| ], | |
| }, | |
| ] | |
| ) | |
| chain = prompt | llm | |