Futuresony commited on
Commit
e64a810
·
verified ·
1 Parent(s): 1aeafc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -66,13 +66,12 @@ async def chat(request: Request):
66
 
67
  # Call your hosted Space
68
  # Pass the api_key received in the FastAPI request to the Gradio chat function
69
- # The gradio_client's predict method maps arguments positionally unless keywords are used and matched by the target function
70
  # Assuming the Gradio `chat` function signature is chat(query, chat_history, api_key)
71
  # Passing arguments positionally as expected by the Gradio endpoint
72
  result = client.predict(
73
- user_message, # query
74
- chat_history, # chat_history
75
- api_key, # api_key
76
  api_name="/chat"
77
  )
78
 
 
66
 
67
  # Call your hosted Space
68
  # Pass the api_key received in the FastAPI request to the Gradio chat function
 
69
  # Assuming the Gradio `chat` function signature is chat(query, chat_history, api_key)
70
  # Passing arguments positionally as expected by the Gradio endpoint
71
  result = client.predict(
72
+ user_message, # query (positional arg 1)
73
+ chat_history, # chat_history (positional arg 2) - using the empty list as before
74
+ api_key, # api_key (positional arg 3) - Pass the client's api_key
75
  api_name="/chat"
76
  )
77