You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.5 KiB
Python
34 lines
1.5 KiB
Python
from aiohttp import web
|
|
from api.controller.ChatComplete import ChatComplete
|
|
|
|
from api.controller.Hanzi import Hanzi
|
|
from api.controller.Index import Index
|
|
from api.controller.Kanji import Kanji
|
|
from api.controller.Hanja import Hanja
|
|
from api.controller.EmbeddingSearch import EmbeddingSearch
|
|
|
|
def init(app: web.Application):
|
|
app.router.add_routes([
|
|
web.route('*', '/hanzi/pinyin/', Hanzi.hanziToPinyin),
|
|
web.route('*', '/hanzi/split/', Hanzi.splitHanzi),
|
|
|
|
web.route('*', '/kanji/romaji/', Kanji.kanji2romaji),
|
|
|
|
web.route('*', '/hanja/romaja/', Hanja.hanja2roma),
|
|
|
|
web.route('*', '/title/info', Index.update_title_info),
|
|
web.route('*', '/user/info', Index.get_user_info),
|
|
web.route('*', '/conversations', Index.get_conversation_list),
|
|
web.route('*', '/conversation/info', Index.get_conversation_info),
|
|
web.route('POST', '/conversation/remove', Index.remove_conversation),
|
|
web.route('DELETE', '/conversation/remove', Index.remove_conversation),
|
|
web.route('POST', '/conversation/set_pinned', Index.set_conversation_pinned),
|
|
|
|
web.route('*', '/embedding_search/index_page', EmbeddingSearch.index_page),
|
|
web.route('*', '/embedding_search/search', EmbeddingSearch.search),
|
|
|
|
web.route('*', '/chatcomplete/conversation_chunks', ChatComplete.get_conversation_chunk_list),
|
|
web.route('*', '/chatcomplete/conversation_chunk/{id:^\d+}', ChatComplete.get_conversation_chunk),
|
|
web.route('*', '/chatcomplete/message', ChatComplete.chat_complete),
|
|
])
|