Add client-mode FastGPT routing
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Literal, Optional
|
||||
|
||||
ClientMode = Literal["direct", "browser_addon"]
|
||||
|
||||
class ProcessRequest_chat(BaseModel):
|
||||
sessionId: str = Field(..., max_length=64)
|
||||
timeStamp: str = Field(..., max_length=32)
|
||||
text: str = Field(...)
|
||||
clientMode: ClientMode = "direct"
|
||||
needFormUpdate: bool = False
|
||||
useTextChunk: bool = False
|
||||
|
||||
@@ -14,7 +17,7 @@ class ProcessResponse_chat(BaseModel):
|
||||
outputText: str = Field(...)
|
||||
formUpdate: Any = Field(default_factory=dict)
|
||||
nextStage: str = Field(..., max_length=32)
|
||||
nextStageCode: str = Field(..., max_length=4)
|
||||
nextStageCode: str = Field(..., max_length=32)
|
||||
code: str = Field(..., max_length=4)
|
||||
msg: Optional[str] = None
|
||||
|
||||
@@ -22,6 +25,7 @@ class ProcessRequest_get(BaseModel):
|
||||
sessionId: str = Field(..., max_length=64)
|
||||
timeStamp: str = Field(..., max_length=32)
|
||||
key: str = Field(...)
|
||||
clientMode: ClientMode = "direct"
|
||||
includeInputInfo: bool = False
|
||||
|
||||
class ProcessResponse_get(BaseModel):
|
||||
@@ -36,6 +40,7 @@ class ProcessRequest_set(BaseModel):
|
||||
timeStamp: str = Field(..., max_length=32)
|
||||
key: str = Field(...)
|
||||
value: str = Field(...)
|
||||
clientMode: ClientMode = "direct"
|
||||
includeInputInfo: bool = False
|
||||
|
||||
class ProcessResponse_set(BaseModel):
|
||||
@@ -47,6 +52,7 @@ class ProcessResponse_set(BaseModel):
|
||||
class ProcessRequest_delete_session(BaseModel):
|
||||
sessionId: str = Field(..., max_length=64)
|
||||
timeStamp: str = Field(..., max_length=32)
|
||||
clientMode: ClientMode = "direct"
|
||||
|
||||
class ProcessResponse_delete_session(BaseModel):
|
||||
sessionId: str = Field(..., max_length=64)
|
||||
|
||||
Reference in New Issue
Block a user