15
15
"PromptLayerOpenAI" : {"batch_generate" : False , "batch_agenerate" : False },
16
16
}
17
17
CHAT_MODEL_IGNORE = ("FakeListChatModel" , "HumanInputChatModel" )
18
+
18
19
CHAT_MODEL_FEAT_TABLE_CORRECTION = {
19
20
"ChatMLflowAIGateway" : {"_agenerate" : False },
20
21
"PromptLayerChatOpenAI" : {"_stream" : False , "_astream" : False },
21
22
"ChatKonko" : {"_astream" : False , "_agenerate" : False },
23
+ "ChatOpenAI" : {"tool_calling" : True },
24
+ "ChatAnthropic" : {"tool_calling" : True },
25
+ "ChatMistralAI" : {"tool_calling" : True },
22
26
}
23
27
28
+
24
29
LLM_TEMPLATE = """\
25
30
---
26
31
sidebar_position: 1
@@ -101,6 +106,7 @@ def get_llm_table():
101
106
"_astream" ,
102
107
"batch_generate" ,
103
108
"batch_agenerate" ,
109
+ "tool_calling" ,
104
110
]
105
111
title = [
106
112
"Model" ,
@@ -110,14 +116,16 @@ def get_llm_table():
110
116
"Async stream" ,
111
117
"Batch" ,
112
118
"Async batch" ,
119
+ "Tool calling" ,
113
120
]
114
121
rows = [title , [":-" ] + [":-:" ] * (len (title ) - 1 )]
115
122
for llm , feats in sorted (final_feats .items ()):
116
123
rows += [[llm , "✅" ] + ["✅" if feats .get (h ) else "❌" for h in header [1 :]]]
117
124
return "\n " .join (["|" .join (row ) for row in rows ])
118
125
119
126
120
- def get_chat_model_table ():
127
+ def get_chat_model_table () -> str :
128
+ """Get the table of chat models."""
121
129
feat_table = {}
122
130
for cm in chat_models .__all__ :
123
131
feat_table [cm ] = {}
@@ -133,8 +141,15 @@ def get_chat_model_table():
133
141
for k , v in {** feat_table , ** CHAT_MODEL_FEAT_TABLE_CORRECTION }.items ()
134
142
if k not in CHAT_MODEL_IGNORE
135
143
}
136
- header = ["model" , "_agenerate" , "_stream" , "_astream" ]
137
- title = ["Model" , "Invoke" , "Async invoke" , "Stream" , "Async stream" ]
144
+ header = ["model" , "_agenerate" , "_stream" , "_astream" , "tool_calling" ]
145
+ title = [
146
+ "Model" ,
147
+ "Invoke" ,
148
+ "Async invoke" ,
149
+ "Stream" ,
150
+ "Async stream" ,
151
+ "Tool calling" ,
152
+ ]
138
153
rows = [title , [":-" ] + [":-:" ] * (len (title ) - 1 )]
139
154
for llm , feats in sorted (final_feats .items ()):
140
155
rows += [[llm , "✅" ] + ["✅" if feats .get (h ) else "❌" for h in header [1 :]]]
0 commit comments