LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmith_openapi_client_utils_transformasync_transform
Function●Since v0.8

async_transform

Copy
async_transform(
    data: _T,
    expected_type: object,
) -> _T
View source on GitHub

Transform dictionaries based off of type information from the given type, for example:

class Params(TypedDict, total=False):
    card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]]

transformed = transform({"card_id": "<my card ID>"}, Params)
# {'cardID': '<my card ID>'}

Any keys / data that does not have type information given will be included as is.

It should be noted that the transformations that this function does are not represented in the type system.