Markdown?
Browse files- app.py +2 -2
- chains/diagnoser_chain.py +1 -1
app.py
CHANGED
|
@@ -51,7 +51,7 @@ async def run_chain(chain_name: str, input_variables: dict, selected_model: str)
|
|
| 51 |
formatted_content = content.replace("\\n", "\n")
|
| 52 |
|
| 53 |
logger.info(f"Chain '{chain_name}' executed successfully.")
|
| 54 |
-
|
| 55 |
return formatted_content
|
| 56 |
|
| 57 |
|
|
@@ -141,7 +141,7 @@ with gr.Blocks() as interface:
|
|
| 141 |
)
|
| 142 |
diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc= ...")
|
| 143 |
diagnoser_button = gr.Button("Submit")
|
| 144 |
-
diagnoser_response_1 = gr.
|
| 145 |
diagnoser_response_2 = gr.Textbox(label="Response 2", interactive=False)
|
| 146 |
diagnoser_response_3 = gr.Textbox(label="Response 3", interactive=False)
|
| 147 |
diagnoser_response_4 = gr.Textbox(label="Response 4", interactive=False)
|
|
|
|
| 51 |
formatted_content = content.replace("\\n", "\n")
|
| 52 |
|
| 53 |
logger.info(f"Chain '{chain_name}' executed successfully.")
|
| 54 |
+
|
| 55 |
return formatted_content
|
| 56 |
|
| 57 |
|
|
|
|
| 141 |
)
|
| 142 |
diagnoser_input = gr.Textbox(label="Enter exercise(s) in any format", placeholder="Exercise body: <mc:exercise xmlns:mc= ...")
|
| 143 |
diagnoser_button = gr.Button("Submit")
|
| 144 |
+
diagnoser_response_1 = gr.Markdown(label="Response 1")
|
| 145 |
diagnoser_response_2 = gr.Textbox(label="Response 2", interactive=False)
|
| 146 |
diagnoser_response_3 = gr.Textbox(label="Response 3", interactive=False)
|
| 147 |
diagnoser_response_4 = gr.Textbox(label="Response 4", interactive=False)
|
chains/diagnoser_chain.py
CHANGED
|
@@ -27,7 +27,7 @@ class DiagnoserChain(BaseModel):
|
|
| 27 |
diagnose_messages = prompt_diagnose.to_messages()
|
| 28 |
diagnosis = await self.llm_diagnose.ainvoke(diagnose_messages)
|
| 29 |
|
| 30 |
-
return diagnosis
|
| 31 |
|
| 32 |
class Config:
|
| 33 |
arbitrary_types_allowed = True
|
|
|
|
| 27 |
diagnose_messages = prompt_diagnose.to_messages()
|
| 28 |
diagnosis = await self.llm_diagnose.ainvoke(diagnose_messages)
|
| 29 |
|
| 30 |
+
return diagnosis.content if hasattr(diagnosis, "content") else diagnosis
|
| 31 |
|
| 32 |
class Config:
|
| 33 |
arbitrary_types_allowed = True
|