You can call .schema() on it to obtain a JSONSchema representation.# The output schema of the chain is the output schema of its last part, in this case a ChatModel, which outputs a ChatMessagechain.output_schema.schema()    {'title': 'ChatOpenAIOutput',     'anyOf': [{'$ref': '#/definitions/HumanMessageChunk'},      {'$ref': '#/definitions/AIMessageChunk'},      {'$ref': '#/definitions/ChatMessageChunk'},      {'$ref': '#/definitions/FunctionMessageChunk'},      {'$ref': '#/definitions/SystemMessageChunk'}],     'definitions': {'HumanMessageChunk': {'title': 'HumanMessageChunk',       'description': 'A Human Message chunk.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'},        'type': {'title': 'Type',         'default': 'human',         'enum': ['human'],         'type': 'string'},        'example': {'title': 'Example', 'default': False, 'type': 'boolean'},        'is_chunk': {'title': 'Is Chunk',         'default': True,         'enum': [True],         'type': 'boolean'}},       'required': ['content']},      'AIMessageChunk': {'title': 'AIMessageChunk',       'description': 'A Message chunk from an AI.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'},        'type': {'title': 'Type',         'default': 'ai',         'enum': ['ai'],         'type': 'string'},        'example': {'title': 'Example', 'default': False, 'type': 'boolean'},        'is_chunk': {'title': 'Is Chunk',         'default': True,         'enum': [True],         'type': 'boolean'}},       'required': ['content']},      'ChatMessageChunk': {'title': 'ChatMessageChunk',       'description': 'A Chat Message chunk.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title':
In an effort to make it as easy as possible to create custom chains, we've implemented a "Runnable" protocol that most components implement. This is a standard interface with a few different methods, which makes it easy to define custom chains as well as making it possible to invoke them in a standard way. The standard interface exposed includes:
In an effort to make it as easy as possible to create custom chains, we've implemented a "Runnable" protocol that most components implement. This is a standard interface with a few different methods, which makes it easy to define custom chains as well as making it possible to invoke them in a standard way. The standard interface exposed includes: ->: You can call .schema() on it to obtain a JSONSchema representation.# The output schema of the chain is the output schema of its last part, in this case a ChatModel, which outputs a ChatMessagechain.output_schema.schema()    {'title': 'ChatOpenAIOutput',     'anyOf': [{'$ref': '#/definitions/HumanMessageChunk'},      {'$ref': '#/definitions/AIMessageChunk'},      {'$ref': '#/definitions/ChatMessageChunk'},      {'$ref': '#/definitions/FunctionMessageChunk'},      {'$ref': '#/definitions/SystemMessageChunk'}],     'definitions': {'HumanMessageChunk': {'title': 'HumanMessageChunk',       'description': 'A Human Message chunk.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'},        'type': {'title': 'Type',         'default': 'human',         'enum': ['human'],         'type': 'string'},        'example': {'title': 'Example', 'default': False, 'type': 'boolean'},        'is_chunk': {'title': 'Is Chunk',         'default': True,         'enum': [True],         'type': 'boolean'}},       'required': ['content']},      'AIMessageChunk': {'title': 'AIMessageChunk',       'description': 'A Message chunk from an AI.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'},        'type': {'title': 'Type',         'default': 'ai',         'enum': ['ai'],         'type': 'string'},        'example': {'title': 'Example', 'default': False, 'type': 'boolean'},        'is_chunk': {'title': 'Is Chunk',         'default': True,         'enum': [True],         'type': 'boolean'}},       'required': ['content']},      'ChatMessageChunk': {'title': 'ChatMessageChunk',       'description': 'A Chat Message chunk.',       'type': 'object',       'properties': {'content': {'title': 'Content', 'type': 'string'},        'additional_kwargs': {'title':