mirror of
https://github.com/senju1337/senju.git
synced 2025-12-23 23:39:27 +00:00
refactor: Apply precommit autochanges
This commit is contained in:
parent
e6da82595a
commit
ab47d13938
5 changed files with 37 additions and 34 deletions
|
|
@ -3,10 +3,13 @@
|
||||||
# For the full list of built-in configuration values, see the documentation:
|
# For the full list of built-in configuration values, see the documentation:
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath("../../senju"))
|
sys.path.insert(0, os.path.abspath("../../senju"))
|
||||||
|
|
||||||
project = 'senju'
|
project = 'senju'
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from flask import (Flask, redirect, render_template, request, url_for,
|
from flask import (Flask, redirect, render_template, request,
|
||||||
send_from_directory)
|
send_from_directory, url_for)
|
||||||
|
|
||||||
from senju.haiku import Haiku
|
from senju.haiku import Haiku
|
||||||
from senju.store_manager import StoreManager
|
from senju.store_manager import StoreManager
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
store = StoreManager(Path("/tmp/store.db"))
|
store = StoreManager(Path("/tmp/store.db"))
|
||||||
|
|
@ -121,7 +120,8 @@ def generate_haiku():
|
||||||
API endpoint to generate a new haiku based on the provided prompt.
|
API endpoint to generate a new haiku based on the provided prompt.
|
||||||
|
|
||||||
Accepts POST requests with JSON data containing a 'prompt' field.
|
Accepts POST requests with JSON data containing a 'prompt' field.
|
||||||
Generates a haiku using the prompt, saves it to the store, and returns the ID.
|
Generates a haiku using the prompt, saves it to the store,
|
||||||
|
and returns the ID.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The ID of the newly created haiku if method is POST.
|
str: The ID of the newly created haiku if method is POST.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue