Skip to main content
Ctrl+K
🦜🔗 LangChain  documentation - Home
  • Reference
  • Legacy reference
Ctrl+K
Docs
  • GitHub
  • X / Twitter
Ctrl+K
  • Reference
  • Legacy reference
Docs
  • GitHub
  • X / Twitter

Section Navigation

Base packages

  • Core
  • Langchain
  • Text Splitters
  • Community
    • adapters
      • Chat
      • ChatCompletion
      • ChatCompletionChunk
      • ChatCompletions
      • Choice
      • ChoiceChunk
      • Completions
      • IndexableBaseModel
      • aenumerate
      • convert_dict_to_message
      • convert_message_to_dict
      • convert_messages_for_finetuning
      • convert_openai_messages
    • agent_toolkits
    • agents
    • cache
    • callbacks
    • chains
    • chat_loaders
    • chat_message_histories
    • chat_models
    • cross_encoders
    • docstore
    • document_compressors
    • document_loaders
    • document_transformers
    • embeddings
    • example_selectors
    • graph_vectorstores
    • graphs
    • indexes
    • llms
    • memory
    • output_parsers
    • query_constructors
    • retrievers
    • storage
    • tools
    • utilities
    • utils
    • vectorstores
  • Experimental

Integrations

  • AI21
  • Airbyte
  • Anthropic
  • AstraDB
  • AWS
  • Azure Dynamic Sessions
  • Chroma
  • Cohere
  • Couchbase
  • Elasticsearch
  • Exa
  • Fireworks
  • Google Community
  • Google GenAI
  • Google VertexAI
  • Groq
  • Huggingface
  • Milvus
  • MistralAI
  • MongoDB
  • Nomic
  • Nvidia Ai Endpoints
  • Ollama
  • OpenAI
  • Pinecone
  • Postgres
  • Prompty
  • Qdrant
  • Robocorp
  • Together
  • Unstructured
  • VoyageAI
  • Weaviate
  • LangChain Python API Reference
  • adapters
  • convert_mess...

convert_messages_for_finetuning#

langchain_community.adapters.openai.convert_messages_for_finetuning(sessions: Iterable[ChatSession]) → List[List[dict]][source]#

Convert messages to a list of lists of dictionaries for fine-tuning.

Parameters:

sessions (Iterable[ChatSession]) – The chat sessions.

Returns:

The list of lists of dictionaries.

Return type:

List[List[dict]]

Examples using convert_messages_for_finetuning

  • Facebook Messenger

  • LangSmith Chat Datasets

  • LangSmith LLM Runs

  • iMessage

On this page
  • convert_messages_for_finetuning()

© Copyright 2023, LangChain Inc.