MCPcopy
hub / github.com/sligter/LandPPT / ChatCompletionRequest

Class ChatCompletionRequest

src/landppt/api/models.py:17–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 name: Optional[str] = Field(None, description="The name of the author of this message")
16
17class ChatCompletionRequest(BaseModel):
18 model: str = Field(..., description="ID of the model to use")
19 messages: List[ChatMessage] = Field(..., description="A list of messages comprising the conversation so far")
20 temperature: Optional[float] = Field(1.0, ge=0, le=2, description="Sampling temperature")
21 max_tokens: Optional[int] = Field(None, gt=0, description="Maximum number of tokens to generate")
22 top_p: Optional[float] = Field(1.0, ge=0, le=1, description="Nucleus sampling parameter")
23 n: Optional[int] = Field(1, ge=1, le=128, description="Number of chat completion choices to generate")
24 stream: Optional[bool] = Field(False, description="Whether to stream back partial progress")
25 stop: Optional[Union[str, List[str]]] = Field(None, description="Up to 4 sequences where the API will stop generating")
26 presence_penalty: Optional[float] = Field(0, ge=-2, le=2, description="Presence penalty parameter")
27 frequency_penalty: Optional[float] = Field(0, ge=-2, le=2, description="Frequency penalty parameter")
28 user: Optional[str] = Field(None, description="A unique identifier representing your end-user")
29
30class CompletionRequest(BaseModel):
31 model: str = Field(..., description="ID of the model to use")

Callers

nothing calls this directly

Calls 1

FieldFunction · 0.85

Tested by

no test coverage detected