from langchain_core.tools import tool from gradio_client import Client @tool def analyze_symptom_image(image_url: str) -> str: """ Calls Nivra Vision Diagnosis Gradio Space using image URL """ try: client = Client("datdevsteve/nivra-vision-diagnosis") result = client.predict( image=image_url, api_name="/predict_gradio" ) return f""" [SYMPTOM IMAGE ANALYSIS - SUCCESS] {result} """ except Exception as e: return f""" [SYMPTOM IMAGE ANALYSIS - ERROR] {str(e)} """