You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(part of yml)
OtherChunkingStrategyResponseParam:
type: object
title: Other Chunking Strategy
description: >-
This is returned when the chunking strategy is unknown. Typically, this is because the file was
indexed before the `chunking_strategy` concept was introduced in the API.
additionalProperties: false
properties:
type:
type: string
description: Always `other`.
enum:
- other
required:
- type
(what i expected)
class OtherChunkingStrategy(BaseModel):
"""
This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API.
"""
model_config = ConfigDict(
extra='forbid',
)
type: Literal['other'] = Field(
..., description='Always `other`.'
)
(What actually happened)
class OtherChunkingStrategy(BaseModel):
"""
This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API.
"""
model_config = ConfigDict(
extra='forbid',
)
type: Literal['OtherChunkingStrategyResponseParam'] = Field(
..., description='Always `other`.'
)
Noted that the 'Literal['OtherChunkingStrategyResponseParam']' instead of Literal['other']
Version:
OS: macis
Python version: 3.12
datamodel-code-generator version: 0.26.0
Additional context
In this case, the frequency of occurrence of only one enumeration value is high。
e.g
class CodeInterpreterImageOutput(BaseModel):
index: int = Field(..., description='The index of the output in the outputs array.')
type: Literal['RunStepDeltaStepDetailsToolCallsCodeOutputImageObject'] = Field(
..., description='Always `image`.'
)
image: Image1 | None = None
class CodeInterpreterLogOutput(BaseModel):
"""
Text output from the Code Interpreter tool call as part of a run step.
"""
index: int = Field(..., description='The index of the output in the outputs array.')
type: Literal['RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject'] = Field(
..., description='Always `logs`.'
)
logs: str | None = Field(
default=None, description='The text output from the Code Interpreter tool call.'
)
The text was updated successfully, but these errors were encountered:
Describe the bug
Often the name is used as the value of Literal
To Reproduce
Example schema:
Used commandline:
Expected behavior
Noted that the 'Literal['OtherChunkingStrategyResponseParam']' instead of Literal['other']
Version:
Additional context
In this case, the frequency of occurrence of only one enumeration value is high。
e.g
The text was updated successfully, but these errors were encountered: