You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw you were switching to Go, but I started working on a rust port.
One thing that stood out to me is how fabric handles sessions. They're treated as unstructured text blobs prepended to a single user message. However, every platform expects chat history encoded as a list of messages tagged with roles. It's pretty difficult to hydrate this format from a flat file that mixes markdown and json without markers and metadata.
I propose wrapping messages in YAML instead. This achieves several additional goals aligned with the current ethos of Fabric. First, it remains human editable, more so than JSON and roughly the same as markdown. Second, markdown and any other text format embeds quite easily in literal string blocks. Third, it's an append-friendly format unlike JSON. You can easily extend the session just by appending to the file without deleting any markers or generating some kind of index.
Here's an example:
- role: querypattern: raw_querycontent: | what is the holographic principle?
- role: replycontent: | the holographic principle is a theoretical concept in physics that suggests our three-dimensional universe may actually be encoded on a two-dimensional surface, like a hologram. the key ideas behind the holographic principle are: 1. information storage: according to the principle, all the information contained within a volume of space can be fully described by the information encoded on the boundary surface of that volume. ...
I have a sample implementation in rust here: patonw@63a034a
I wouldn't mind backporting it to python if it's still going to be supported going forward.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I saw you were switching to Go, but I started working on a rust port.
One thing that stood out to me is how fabric handles sessions. They're treated as unstructured text blobs prepended to a single user message. However, every platform expects chat history encoded as a list of messages tagged with roles. It's pretty difficult to hydrate this format from a flat file that mixes markdown and json without markers and metadata.
I propose wrapping messages in YAML instead. This achieves several additional goals aligned with the current ethos of Fabric. First, it remains human editable, more so than JSON and roughly the same as markdown. Second, markdown and any other text format embeds quite easily in literal string blocks. Third, it's an append-friendly format unlike JSON. You can easily extend the session just by appending to the file without deleting any markers or generating some kind of index.
Here's an example:
I have a sample implementation in rust here: patonw@63a034a
I wouldn't mind backporting it to python if it's still going to be supported going forward.
Beta Was this translation helpful? Give feedback.
All reactions