akhaliq HF Staff commited on
Commit
e759c0c
·
1 Parent(s): 18c682d

fix: Add return type hint -> str to chat endpoint to prevent UserWarning and enable client data reception

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -18,7 +18,7 @@ async def get_hf_token_status():
18
  return {"has_token": token_exists}
19
 
20
  @app.api(name="chat")
21
- async def chat(messages_json: str, temperature: float = 0.7, max_tokens: int = 1024, custom_token: str = None):
22
  # Check for Hugging Face token: custom override or environment variable
23
  hf_token = (custom_token and custom_token.strip()) or os.environ.get("HF_TOKEN")
24
 
 
18
  return {"has_token": token_exists}
19
 
20
  @app.api(name="chat")
21
+ async def chat(messages_json: str, temperature: float = 0.7, max_tokens: int = 1024, custom_token: str = None) -> str:
22
  # Check for Hugging Face token: custom override or environment variable
23
  hf_token = (custom_token and custom_token.strip()) or os.environ.get("HF_TOKEN")
24