doc: 补全部分注释

This commit is contained in:
RockChinQ
2024-03-03 16:34:59 +08:00
parent ce881372ee
commit 2fe6d731b8
34 changed files with 66 additions and 17 deletions

View File

@@ -20,6 +20,8 @@ class ToolCall(pydantic.BaseModel):
class Message(pydantic.BaseModel):
"""消息"""
role: str # user, system, assistant, tool, command
name: typing.Optional[str] = None

View File

@@ -18,6 +18,8 @@ from ...tools import entities as tools_entities
class OpenAIChatCompletion(api.LLMAPIRequester):
"""OpenAI ChatCompletion API 请求器"""
client: openai.AsyncClient
async def initialize(self):

View File

@@ -9,6 +9,7 @@ from .tokenizers import tiktoken
class ModelManager:
"""模型管理器"""
ap: app.Application

View File

@@ -6,6 +6,8 @@ import pydantic
class TokenManager():
"""鉴权 Token 管理器
"""
provider: str

View File

@@ -9,6 +9,7 @@ from . import entities
class LLMTokenizer(metaclass=abc.ABCMeta):
"""LLM分词器抽象类"""
ap: app.Application

View File

@@ -8,6 +8,8 @@ from .. import entities
class Tiktoken(tokenizer.LLMTokenizer):
"""TikToken分词器
"""
async def count_token(
self,

View File

@@ -6,6 +6,8 @@ from ...core import app, entities as core_entities
class SessionManager:
"""会话管理器
"""
ap: app.Application
@@ -39,6 +41,8 @@ class SessionManager:
return session
async def get_conversation(self, session: core_entities.Session) -> core_entities.Conversation:
"""获取对话或创建对话"""
if not session.conversations:
session.conversations = []

View File

@@ -6,6 +6,8 @@ from .loaders import single, scenario
class PromptManager:
"""Prompt管理器
"""
ap: app.Application