14 lines
338 B
Python
14 lines
338 B
Python
import requests
|
|
|
|
|
|
class LlmApi:
|
|
def __init__(self, host="127.0.0.1", port=8000):
|
|
self.host = host
|
|
self.port = port
|
|
self.url = f"http://{host}:{port}"
|
|
|
|
def ask(self, question):
|
|
url = self.url + "/ask"
|
|
response = requests.post(url, json={"question": question})
|
|
return response.json()
|