mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-09-09 15:53:16 +01:00
Compare commits
2 Commits
4ea81daa47
...
73acc92ee4
Author | SHA1 | Date | |
---|---|---|---|
73acc92ee4 | |||
bfbf8d82e0 |
@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.2.4"
|
current_version = "0.2.5"
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
search = "{current_version}"
|
search = "{current_version}"
|
||||||
|
@ -3,6 +3,7 @@ import logging
|
|||||||
import litellm
|
import litellm
|
||||||
import nest_asyncio
|
import nest_asyncio
|
||||||
from libs.generic import load_recent_prompts, load_config
|
from libs.generic import load_recent_prompts, load_config
|
||||||
|
import re
|
||||||
nest_asyncio.apply()
|
nest_asyncio.apply()
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
@ -74,5 +75,10 @@ def create_prompt_on_openwebui(prompt: str, topic: str = "random") -> str:
|
|||||||
# api_key=user_config["openwebui"]["api_key"],
|
# api_key=user_config["openwebui"]["api_key"],
|
||||||
# )
|
# )
|
||||||
# prompt = response["choices"][0]["message"]["content"].strip('"')
|
# prompt = response["choices"][0]["message"]["content"].strip('"')
|
||||||
|
match = re.search(r'"([^"]+)"', prompt)
|
||||||
|
if not match:
|
||||||
|
match = re.search(r":\s*\n*\s*(.+)", prompt)
|
||||||
|
if match:
|
||||||
|
prompt = match.group(1)
|
||||||
logging.debug(prompt)
|
logging.debug(prompt)
|
||||||
return prompt.split(": ")[-1]
|
return prompt
|
Loading…
x
Reference in New Issue
Block a user