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

    Create a Citation.

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

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

    Parameters

    NameTypeDescription
    urlstr | None
    Default:None

    URL of the document source.

    titlestr | None
    Default:None

    Source document title.

    start_indexint | None
    Default:None

    Start index in the response text where citation applies.

    end_indexint | None
    Default:None

    End index in the response text where citation applies.

    cited_textstr | None
    Default:None

    Excerpt of source text being cited.

    idstr | None
    Default:None

    Content block identifier.

    Generated automatically if not provided.

    View source on GitHub