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
PythonlangsmithresourcescommitsCommitsResourceretrieve
Method●Since v0.15

retrieve

Copy
retrieve(
  self,
  commit: str,
  *,
  owner: str,
  repo: str
View source on GitHub
,
get_examples
:
bool
|
Omit
=
omit
,
include
:
str
|
Omit
=
omit
,
include_model
:
bool
|
Omit
=
omit
,
is_view
:
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
)
->
CommitRetrieveResponse

Parameters

NameTypeDescription
includestr | Omit
Default:omit

Comma-separated list of optional fields: "model", "is_draft"

include_modelbool | Omit
Default:omit

Deprecated: use Include instead

extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Retrieves a specific commit by hash, tag, or "latest" for a repository.

This endpoint supports both authenticated and unauthenticated access. Authenticated users can access private repos, while unauthenticated users can only access public repos. Commit resolution logic:

  • "latest" or empty: Get the most recent commit
  • Less than 8 characters: Only check for tags
  • 8 or more characters: Prioritize commit hash over tag, check both

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