mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-05 12:48:12 +00:00
core[patch]: Release 0.2.29 (#25126)
This commit is contained in:
parent
dff83cce66
commit
b4c12346cc
@ -327,15 +327,23 @@ def convert_to_openai_function(
|
||||
) -> Dict[str, Any]:
|
||||
"""Convert a raw function/class to an OpenAI function.
|
||||
|
||||
.. versionchanged:: 0.2.29
|
||||
|
||||
``strict`` arg added.
|
||||
|
||||
Args:
|
||||
function: A dictionary, Pydantic BaseModel class, TypedDict class, a LangChain
|
||||
function:
|
||||
A dictionary, Pydantic BaseModel class, TypedDict class, a LangChain
|
||||
Tool object, or a Python function. If a dictionary is passed in, it is
|
||||
assumed to already be a valid OpenAI function or a JSON schema with
|
||||
top-level 'title' and 'description' keys specified.
|
||||
strict: If True, model output is guaranteed to exactly match the JSON Schema
|
||||
strict:
|
||||
If True, model output is guaranteed to exactly match the JSON Schema
|
||||
provided in the function definition. If None, ``strict`` argument will not
|
||||
be included in function definition.
|
||||
|
||||
.. versionadded:: 0.2.29
|
||||
|
||||
Returns:
|
||||
A dict version of the passed in function which is compatible with the OpenAI
|
||||
function-calling API.
|
||||
@ -393,18 +401,26 @@ def convert_to_openai_tool(
|
||||
) -> Dict[str, Any]:
|
||||
"""Convert a raw function/class to an OpenAI tool.
|
||||
|
||||
.. versionchanged:: 0.2.29
|
||||
|
||||
``strict`` arg added.
|
||||
|
||||
Args:
|
||||
tool: Either a dictionary, a pydantic.BaseModel class, Python function, or
|
||||
tool:
|
||||
Either a dictionary, a pydantic.BaseModel class, Python function, or
|
||||
BaseTool. If a dictionary is passed in, it is assumed to already be a valid
|
||||
OpenAI tool, OpenAI function, or a JSON schema with top-level 'title' and
|
||||
'description' keys specified.
|
||||
strict: If True, model output is guaranteed to exactly match the JSON Schema
|
||||
strict:
|
||||
If True, model output is guaranteed to exactly match the JSON Schema
|
||||
provided in the function definition. If None, ``strict`` argument will not
|
||||
be included in tool definition.
|
||||
|
||||
.. versionadded:: 0.2.29
|
||||
|
||||
Returns:
|
||||
A dict version of the passed in tool which is compatible with the
|
||||
OpenAI tool-calling API.
|
||||
OpenAI tool-calling API.
|
||||
"""
|
||||
if isinstance(tool, dict) and tool.get("type") == "function" and "function" in tool:
|
||||
return tool
|
||||
|
@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "langchain-core"
|
||||
version = "0.2.29rc1"
|
||||
version = "0.2.29"
|
||||
description = "Building applications with LLMs through composability"
|
||||
authors = []
|
||||
license = "MIT"
|
||||
|
Loading…
Reference in New Issue
Block a user