Skip to content

Commit 9a394c8

Browse files
authored
Merge pull request #524 from aurelio-labs/fix/function-schemas-len
fix: handle empty function_schemas in route processing
2 parents e77ed92 + 751c1d6 commit 9a394c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

semantic_router/routers/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,11 @@ def _extract_routes_details(
10861086
route_names = [route.name for route in routes for _ in route.utterances]
10871087
utterances = [utterance for route in routes for utterance in route.utterances]
10881088
function_schemas = [
1089-
route.function_schemas[0] if route.function_schemas is not None else {}
1089+
(
1090+
route.function_schemas[0]
1091+
if route.function_schemas and len(route.function_schemas) > 0
1092+
else {}
1093+
)
10901094
for route in routes
10911095
for _ in route.utterances
10921096
]

0 commit comments

Comments
 (0)