Update app.py
Browse files
app.py
CHANGED
@@ -47,9 +47,11 @@ llm = LiteLLMModel(model_id="gemini/gemini-pro", api_key=gemini_api_key)
|
|
47 |
def call_llm(prompt: str) -> str:
|
48 |
"""
|
49 |
Helper to call the LLM with a prompt, handling response extraction.
|
|
|
50 |
"""
|
51 |
try:
|
52 |
-
|
|
|
53 |
return result if isinstance(result, str) else str(result)
|
54 |
except Exception as e:
|
55 |
logger.error(f"LLM call error: {e}")
|
|
|
47 |
def call_llm(prompt: str) -> str:
|
48 |
"""
|
49 |
Helper to call the LLM with a prompt, handling response extraction.
|
50 |
+
Passes the prompt as a dictionary as expected by LiteLLMModel.
|
51 |
"""
|
52 |
try:
|
53 |
+
# Pass prompt in a dictionary format expected by the model
|
54 |
+
result = llm({"prompt": prompt})
|
55 |
return result if isinstance(result, str) else str(result)
|
56 |
except Exception as e:
|
57 |
logger.error(f"LLM call error: {e}")
|