test_schemas.py 544 B

12345678910111213141516171819202122
  1. # !/usr/bin/ python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Project : lq-agent-api
  5. @File :test_schemas.py
  6. @IDE :PyCharm
  7. @Author :
  8. @Date :2025/7/11 12:41
  9. '''
  10. from typing import Optional
  11. from pydantic import BaseModel, constr, Field
  12. class FormConfig(BaseModel):
  13. session_id: constr(max_length=128) =Field(description="会话id")
  14. class TestForm(BaseModel):
  15. config: FormConfig
  16. input: Optional[str] = Field(description="用户输入")
  17. context: Optional[str] = Field(default=None, description="参考上下文")