Skip to content

Commit 4a72b6e

Browse files
committed
include fiunction_calling field for each model
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
1 parent 0826159 commit 4a72b6e

1 file changed

Lines changed: 32 additions & 6 deletions

File tree

  • python/packages/autogen-studio/autogenstudio/web/routes
Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, List
1+
from typing import Any, Dict, List
22

33
from autogen_ext.models.anthropic._model_info import _MODEL_INFO as anthropic_models
44
from autogen_ext.models.ollama._model_info import _MODEL_INFO as ollama_models
@@ -9,12 +9,38 @@
99

1010

1111
@router.get("/")
12-
async def list_models() -> Dict[str, List[str]]:
12+
async def list_models() -> Dict[str, List[Dict[str, Any]]]:
13+
# Get the model names from the model info, also get the "function_calling" value for each model
14+
1315
response = {
14-
"anthropic": list(anthropic_models.keys()),
15-
"ollama": list(ollama_models.keys()),
16-
"openAI": list(openai_models.keys()),
17-
"azureOpenAI": list(openai_models.keys()),
16+
"anthropic": [
17+
{
18+
"name": model,
19+
"function_calling": anthropic_models[model]["function_calling"],
20+
}
21+
for model in anthropic_models.keys()
22+
],
23+
"ollama": [
24+
{
25+
"name": model,
26+
"function_calling": ollama_models[model]["function_calling"],
27+
}
28+
for model in ollama_models.keys()
29+
],
30+
"openAI": [
31+
{
32+
"name": model,
33+
"function_calling": openai_models[model]["function_calling"],
34+
}
35+
for model in openai_models.keys()
36+
],
37+
"azureOpenAI": [
38+
{
39+
"name": model,
40+
"function_calling": openai_models[model]["function_calling"],
41+
}
42+
for model in openai_models.keys()
43+
],
1844
}
1945

2046
return response

0 commit comments

Comments
 (0)