Phoenix21 commited on
Commit
204f7f7
·
verified ·
1 Parent(s): 545ad92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- result = llm(prompt) # Directly call the model with the prompt
 
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}")