'logs': {},                'streamed_output': []}})    RunLogPatch({'op': 'add',      'path': '/logs/Docs',      'value': {'end_time': None,                'final_output': None,                'id': '8c998257-1ec8-4546-b744-c3fdb9728c41',                'metadata': {},                'name': 'Docs',                'start_time': '2023-10-05T12:52:35.668',                'streamed_output_str': [],                'tags': ['map:key:context', 'FAISS'],                'type': 'retriever'}})    RunLogPatch({'op': 'add',      'path': '/logs/Docs/final_output',      'value': {'documents': [Document(page_content='harrison worked at kensho')]}},     {'op': 'add',      'path': '/logs/Docs/end_time',      'value': '2023-10-05T12:52:36.033'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ''})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'H'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'arrison'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' worked'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' at'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' Kens'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'ho'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': '.'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ''})    RunLogPatch({'op': 'replace',      'path': '/final_output',      'value': {'output': 'Harrison worked at Kensho.'}})Streaming the incremental RunState‚ÄãYou can simply pass diff=False to get incremental values of RunState.async for chunk in retrieval_chain.astream_log("where did harrison work?", include_names=['Docs'], diff=False):    print(chunk)    RunLog({'final_output': None,     'id': 'f95ccb87-31f1-48ea-a51c-d2dadde44185',     'logs': {},     'streamed_output': []})    RunLog({'final_output': None,     'id': 'f95ccb87-31f1-48ea-a51c-d2dadde44185',
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: ->: 'logs': {},                'streamed_output': []}})    RunLogPatch({'op': 'add',      'path': '/logs/Docs',      'value': {'end_time': None,                'final_output': None,                'id': '8c998257-1ec8-4546-b744-c3fdb9728c41',                'metadata': {},                'name': 'Docs',                'start_time': '2023-10-05T12:52:35.668',                'streamed_output_str': [],                'tags': ['map:key:context', 'FAISS'],                'type': 'retriever'}})    RunLogPatch({'op': 'add',      'path': '/logs/Docs/final_output',      'value': {'documents': [Document(page_content='harrison worked at kensho')]}},     {'op': 'add',      'path': '/logs/Docs/end_time',      'value': '2023-10-05T12:52:36.033'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ''})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'H'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'arrison'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' worked'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' at'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ' Kens'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': 'ho'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': '.'})    RunLogPatch({'op': 'add', 'path': '/streamed_output/-', 'value': ''})    RunLogPatch({'op': 'replace',      'path': '/final_output',      'value': {'output': 'Harrison worked at Kensho.'}})Streaming the incremental RunState‚ÄãYou can simply pass diff=False to get incremental values of RunState.async for chunk in retrieval_chain.astream_log("where did harrison work?", include_names=['Docs'], diff=False):    print(chunk)    RunLog({'final_output': None,     'id': 'f95ccb87-31f1-48ea-a51c-d2dadde44185',     'logs': {},     'streamed_output': []})    RunLog({'final_output': None,     'id': 'f95ccb87-31f1-48ea-a51c-d2dadde44185',