docs: add structred output to feat table (#20539)

This commit is contained in:
Bagatur 2024-04-16 19:14:26 -07:00 committed by GitHub
parent 479be3cc91
commit c05c379b26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 50 additions and 15 deletions

View File

@ -86,7 +86,7 @@
"id": "deddb6d3", "id": "deddb6d3",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### Function Calling\n", "#### Tool/function Calling\n",
"\n", "\n",
"By default, we will use `function_calling`" "By default, we will use `function_calling`"
] ]
@ -128,7 +128,7 @@
"id": "39d7a555", "id": "39d7a555",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### JSON Mode\n", "#### JSON Mode\n",
"\n", "\n",
"We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in." "We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in."
] ]
@ -193,7 +193,7 @@
"id": "36270ed5", "id": "36270ed5",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### Function Calling\n", "#### Tool/function Calling\n",
"\n", "\n",
"By default, we will use `function_calling`" "By default, we will use `function_calling`"
] ]
@ -235,7 +235,7 @@
"id": "ddb6b3ba", "id": "ddb6b3ba",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### JSON Mode\n", "#### JSON Mode\n",
"\n", "\n",
"We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in." "We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in."
] ]
@ -401,7 +401,7 @@
"id": "6b7e97a6", "id": "6b7e97a6",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### Function Calling\n", "#### Tool/function Calling\n",
"\n", "\n",
"By default, we will use `function_calling`" "By default, we will use `function_calling`"
] ]
@ -452,7 +452,7 @@
"id": "a82c2f55", "id": "a82c2f55",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### JSON Mode\n", "#### JSON Mode\n",
"\n", "\n",
"We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in." "We also support JSON mode. Note that we need to specify in the prompt the format that it should respond in."
] ]
@ -532,7 +532,7 @@
"id": "6c797e2d-3115-4ca2-9c2f-e853bdc7956d", "id": "6c797e2d-3115-4ca2-9c2f-e853bdc7956d",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Vertex AI\n", "## Google Vertex AI\n",
"\n", "\n",
"Google's Gemini models support [function-calling](https://ai.google.dev/docs/function_calling), which we can access via Vertex AI and use for structuring outputs.\n", "Google's Gemini models support [function-calling](https://ai.google.dev/docs/function_calling), which we can access via Vertex AI and use for structuring outputs.\n",
"\n", "\n",

View File

@ -20,13 +20,46 @@ CHAT_MODEL_FEAT_TABLE_CORRECTION = {
"ChatMLflowAIGateway": {"_agenerate": False}, "ChatMLflowAIGateway": {"_agenerate": False},
"PromptLayerChatOpenAI": {"_stream": False, "_astream": False}, "PromptLayerChatOpenAI": {"_stream": False, "_astream": False},
"ChatKonko": {"_astream": False, "_agenerate": False}, "ChatKonko": {"_astream": False, "_agenerate": False},
"ChatAnthropic": {"tool_calling": True, "package": "langchain-anthropic"}, "ChatAnthropic": {
"ChatMistralAI": {"tool_calling": True, "package": "langchain-mistralai"}, "tool_calling": True,
"ChatFireworks": {"tool_calling": True, "package": "langchain-fireworks"}, "structured_output": True,
"ChatOpenAI": {"tool_calling": True, "package": "langchain-openai"}, "package": "langchain-anthropic",
"ChatVertexAI": {"tool_calling": True, "package": "langchain-google-vertexai"}, },
"ChatGroq": {"tool_calling": "partial", "package": "langchain-groq"}, "ChatMistralAI": {
"ChatCohere": {"tool_calling": "partial", "package": "langchain-cohere"}, "tool_calling": True,
"structured_output": True,
"package": "langchain-mistralai",
},
"ChatFireworks": {
"tool_calling": True,
"structured_output": True,
"package": "langchain-fireworks",
},
"AzureChatOpenAI": {
"tool_calling": True,
"structured_output": True,
"package": "langchain-openai",
},
"ChatOpenAI": {
"tool_calling": True,
"structured_output": True,
"package": "langchain-openai",
},
"ChatVertexAI": {
"tool_calling": True,
"structured_output": True,
"package": "langchain-google-vertexai",
},
"ChatGroq": {
"tool_calling": "partial",
"structured_output": True,
"package": "langchain-groq",
},
"ChatCohere": {
"tool_calling": "partial",
"structured_output": True,
"package": "langchain-cohere",
},
} }
@ -152,6 +185,7 @@ def get_chat_model_table() -> str:
"_stream", "_stream",
"_astream", "_astream",
"tool_calling", "tool_calling",
"structured_output",
"package", "package",
] ]
title = [ title = [
@ -160,7 +194,8 @@ def get_chat_model_table() -> str:
"Async invoke", "Async invoke",
"Stream", "Stream",
"Async stream", "Async stream",
"Tool calling", "[Tool calling](/docs/modules/model_io/chat/function_calling/)",
"[Structured output](/docs/modules/model_io/chat/structured_output/)",
"Python Package", "Python Package",
] ]
rows = [title, [":-"] + [":-:"] * (len(title) - 1)] rows = [title, [":-"] + [":-:"] * (len(title) - 1)]