Skip to content

Commit e9272a4

Browse files
committed
Refactor: simplify items initialization with ternary expression
Address Copilot suggestion to remove redundant initialization by using a ternary expression instead of if-else block.
1 parent ee820fc commit e9272a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/agents/extensions/models/litellm_model.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ async def get_response(
167167
"output_tokens": usage.output_tokens,
168168
}
169169

170-
items = []
171-
if message is not None:
172-
items = Converter.message_to_output_items(
170+
items = (
171+
Converter.message_to_output_items(
173172
LitellmConverter.convert_message_to_openai(message)
174173
)
174+
if message is not None
175+
else []
176+
)
175177

176178
return ModelResponse(
177179
output=items,

0 commit comments

Comments
 (0)