chore: more mypy fixes (#2029)

# What does this PR do?

Mainly tried to cover the entire llama_stack/apis directory, we only
have one left. Some excludes were just noop.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-05-06 18:52:31 +02:00 committed by GitHub
parent feb9eb8b0d
commit 1a529705da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 581 additions and 166 deletions

View file

@ -2812,10 +2812,13 @@ components:
properties:
type:
type: string
const: grammar
default: grammar
enum:
- json_schema
- grammar
description: >-
Must be "grammar" to identify this format type
const: grammar
default: grammar
bnf:
type: object
additionalProperties:
@ -2897,10 +2900,13 @@ components:
properties:
type:
type: string
const: json_schema
default: json_schema
enum:
- json_schema
- grammar
description: >-
Must be "json_schema" to identify this format type
const: json_schema
default: json_schema
json_schema:
type: object
additionalProperties:
@ -3959,6 +3965,13 @@ components:
description: The time the step completed.
step_type:
type: string
enum:
- inference
- tool_execution
- shield_call
- memory_retrieval
title: StepType
description: Type of the step in an agent turn.
const: inference
default: inference
model_response:
@ -3991,6 +4004,13 @@ components:
description: The time the step completed.
step_type:
type: string
enum:
- inference
- tool_execution
- shield_call
- memory_retrieval
title: StepType
description: Type of the step in an agent turn.
const: memory_retrieval
default: memory_retrieval
vector_db_ids:
@ -4052,6 +4072,13 @@ components:
description: The time the step completed.
step_type:
type: string
enum:
- inference
- tool_execution
- shield_call
- memory_retrieval
title: StepType
description: Type of the step in an agent turn.
const: shield_call
default: shield_call
violation:
@ -4083,6 +4110,13 @@ components:
description: The time the step completed.
step_type:
type: string
enum:
- inference
- tool_execution
- shield_call
- memory_retrieval
title: StepType
description: Type of the step in an agent turn.
const: tool_execution
default: tool_execution
tool_calls:
@ -4245,6 +4279,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: step_complete
default: step_complete
step_type:
@ -4283,6 +4325,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: step_progress
default: step_progress
step_type:
@ -4310,6 +4360,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: step_start
default: step_start
step_type:
@ -4354,6 +4412,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: turn_awaiting_input
default: turn_awaiting_input
turn:
@ -4369,6 +4435,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: turn_complete
default: turn_complete
turn:
@ -4383,6 +4457,14 @@ components:
properties:
event_type:
type: string
enum:
- step_start
- step_complete
- step_progress
- turn_start
- turn_complete
- turn_awaiting_input
title: AgentTurnResponseEventType
const: turn_start
default: turn_start
turn_id:
@ -4825,7 +4907,7 @@ components:
type: object
properties:
type:
type: string
$ref: '#/components/schemas/ScoringFnParamsType'
const: basic
default: basic
aggregation_functions:
@ -4835,6 +4917,7 @@ components:
additionalProperties: false
required:
- type
- aggregation_functions
title: BasicScoringFnParams
BenchmarkConfig:
type: object
@ -4874,7 +4957,7 @@ components:
type: object
properties:
type:
type: string
$ref: '#/components/schemas/ScoringFnParamsType'
const: llm_as_judge
default: llm_as_judge
judge_model:
@ -4893,6 +4976,8 @@ components:
required:
- type
- judge_model
- judge_score_regexes
- aggregation_functions
title: LLMAsJudgeScoringFnParams
ModelCandidate:
type: object
@ -4923,7 +5008,7 @@ components:
type: object
properties:
type:
type: string
$ref: '#/components/schemas/ScoringFnParamsType'
const: regex_parser
default: regex_parser
parsing_regexes:
@ -4937,6 +5022,8 @@ components:
additionalProperties: false
required:
- type
- parsing_regexes
- aggregation_functions
title: RegexParserScoringFnParams
ScoringFnParams:
oneOf:
@ -4949,6 +5036,13 @@ components:
llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams'
regex_parser: '#/components/schemas/RegexParserScoringFnParams'
basic: '#/components/schemas/BasicScoringFnParams'
ScoringFnParamsType:
type: string
enum:
- llm_as_judge
- regex_parser
- basic
title: ScoringFnParamsType
EvaluateRowsRequest:
type: object
properties:
@ -5111,6 +5205,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: benchmark
default: benchmark
dataset_id:
@ -5132,7 +5236,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- dataset_id
@ -5159,6 +5262,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: dataset
default: dataset
purpose:
@ -5185,7 +5298,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- purpose
@ -5284,6 +5396,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: model
default: model
metadata:
@ -5302,7 +5424,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- metadata
@ -5438,6 +5559,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: scoring_function
default: scoring_function
description:
@ -5459,7 +5590,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- metadata
@ -5498,6 +5628,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: shield
default: shield
params:
@ -5513,7 +5653,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
title: Shield
@ -5628,6 +5767,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: tool
default: tool
toolgroup_id:
@ -5653,7 +5802,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- toolgroup_id
@ -5679,6 +5827,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: tool_group
default: tool_group
mcp_endpoint:
@ -5696,7 +5854,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
title: ToolGroup
@ -5810,6 +5967,16 @@ components:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
title: ResourceType
const: vector_db
default: vector_db
embedding_model:
@ -5819,7 +5986,6 @@ components:
additionalProperties: false
required:
- identifier
- provider_resource_id
- provider_id
- type
- embedding_model
@ -6259,6 +6425,13 @@ components:
unstructured_log: '#/components/schemas/UnstructuredLogEvent'
metric: '#/components/schemas/MetricEvent'
structured_log: '#/components/schemas/StructuredLogEvent'
EventType:
type: string
enum:
- unstructured_log
- structured_log
- metric
title: EventType
LogSeverity:
type: string
enum:
@ -6289,7 +6462,7 @@ components:
- type: boolean
- type: 'null'
type:
type: string
$ref: '#/components/schemas/EventType'
const: metric
default: metric
metric:
@ -6314,7 +6487,7 @@ components:
type: object
properties:
type:
type: string
$ref: '#/components/schemas/StructuredLogType'
const: span_end
default: span_end
status:
@ -6328,7 +6501,7 @@ components:
type: object
properties:
type:
type: string
$ref: '#/components/schemas/StructuredLogType'
const: span_start
default: span_start
name:
@ -6360,7 +6533,7 @@ components:
- type: boolean
- type: 'null'
type:
type: string
$ref: '#/components/schemas/EventType'
const: structured_log
default: structured_log
payload:
@ -6382,6 +6555,12 @@ components:
mapping:
span_start: '#/components/schemas/SpanStartPayload'
span_end: '#/components/schemas/SpanEndPayload'
StructuredLogType:
type: string
enum:
- span_start
- span_end
title: StructuredLogType
UnstructuredLogEvent:
type: object
properties:
@ -6402,7 +6581,7 @@ components:
- type: boolean
- type: 'null'
type:
type: string
$ref: '#/components/schemas/EventType'
const: unstructured_log
default: unstructured_log
message: