mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +00:00
tests: add test for request_haiku
Refs: OPS-70
This commit is contained in:
parent
aa236775ba
commit
897bf80e38
4 changed files with 36 additions and 9 deletions
|
|
@ -18,7 +18,7 @@ class Haiku:
|
|||
return json.dumps(self.lines)
|
||||
|
||||
@staticmethod
|
||||
def request_haiku(seed: str) -> Haiku:
|
||||
def request_haiku(seed: str, url=AI_BASE_URL + AI_GEN_ENDPOINT) -> Haiku:
|
||||
"""This function prompts the ai to generate
|
||||
the hauku based on the user input"""
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class Haiku:
|
|||
|
||||
while True:
|
||||
try:
|
||||
r = requests.post(url=AI_BASE_URL + AI_GEN_ENDPOINT,
|
||||
r = requests.post(url=url,
|
||||
json=ai_gen_request)
|
||||
ai_response = str(r.json()["response"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue