Spaces:
Runtime error
Runtime error
Download api_call.py from DevsDoCode/Bing: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/spaces/DevsDoCode/Bing/resolve/1dccd50f92514948b3a8610a8e5fee5bb40f742e/api_call.py
- Command line
-
hf download hf://spaces/DevsDoCode/Bing@1dccd50f92514948b3a8610a8e5fee5bb40f742e/api_call.py
-
curl -L -o api_call.py https://huggingface.co/spaces/DevsDoCode/Bing/resolve/1dccd50f92514948b3a8610a8e5fee5bb40f742e/api_call.py
449 Bytes
| import requests | |
| def generate_request(conversation_history): | |
| url = "https://devsdocode-bing.hf.space/generate" | |
| params = { | |
| "conversation_history": conversation_history, | |
| } | |
| response = requests.get(url, params=params) | |
| return response.text | |
| if __name__ == "__main__": | |
| # Example usage: | |
| query = [{"role": "user", "content": "Who is Devs Do Code"}] | |
| response = generate_request(query) | |
| print(response) |