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

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
PythonlangsmithresourcesagentsAsyncAgentsResourcecreate
Method●Since v0.14

create

Copy
create(
  self,
  *,
  id: str,
  source_type: Literal['LSD', 'MDA', 'EXTERNAL'
View source on GitHub
,
'FLEET'
]
,
agent_type
:
Literal
[
'CUSTOM'
,
'CODING'
]
|
Omit
=
omit
,
name
:
str
|
Omit
=
omit
,
production_only
:
bool
|
Omit
=
omit
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
Agent

Parameters

NameTypeDescription
id*str

Unique agent identifier: 1-63 lowercase letters, digits, or hyphens, starting with a letter and ending with a letter or digit.

source_type*Literal['LSD', 'MDA', 'EXTERNAL', 'FLEET']

Agent runtime kind. Use EXTERNAL for an application hosted outside LangSmith.

agent_typeLiteral['CUSTOM', 'CODING'] | Omit
Default:omit
namestr | Omit
Default:omit
production_onlybool | Omit
Default:omit
extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Creates an Agent with a caller-assigned ID.

Returns 409 if the ID already exists. Creates all four environments unless production_only is set for a FLEET agent. agent_type defaults to CUSTOM. Requires permission to create projects. The response does not include runtime bindings.

AgentType defaults to CUSTOM when omitted.

Display name. Defaults to the agent ID.

ProductionOnly creates only the PRODUCTION environment. It is accepted only when SourceType is FLEET; other sources always get all four environments.

Send extra headers

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds