LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessagescontentcreate_citation
    Functionā—Since v1.0

    create_citation

    Copy
    create_citation(
      *,
      url: str | None = None,
      title: str | None 
    View source on GitHub
    =
    None
    ,
    start_index
    :
    int
    |
    None
    =
    None
    ,
    end_index
    :
    int
    |
    None
    =
    None
    ,
    cited_text
    :
    str
    |
    None
    =
    None
    ,
    id
    :
    str
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    Citation

    Parameters

    NameTypeDescription
    urlstr | None
    Default:None

    URL of the document source.

    titlestr | None
    Default:None

    Source document title.

    start_indexint | None
    Default:None
    end_indexint | None
    Default:None
    cited_textstr | None
    Default:None
    idstr | None
    Default:None

    Create a Citation.

    The id is generated automatically if not provided, using a UUID4 format prefixed with 'lc_' to indicate it is a LangChain-generated ID.

    Start index in the response text where citation applies.

    End index in the response text where citation applies.

    Excerpt of source text being cited.

    Content block identifier.

    Generated automatically if not provided.