Saving the blob to the manager as it is returned from the invocation#143
Saving the blob to the manager as it is returned from the invocation#143julianstirling wants to merge 1 commit intomainfrom
Conversation
b2610c7 to
26c1121
Compare
|
I think adding the blob to the manager and getting an ID can absolutely be done whenever - holding a bunch of weak references keyed by UUIDs feels like something that's ok in a module level global or singleton, so there wouldn't even be any need to explicitly pass the blob manager. I think the trickier part is going from ID to URL. We ought to be using 90% of the time this will not matter because we can guess the URL correctly. But it does sometimes matter and I was hoping to follow convention. There are a few other places where we should really be using I can't imagine this is three first project with this issue, but I did a bit of looking and have not yet found a neat solution. |
|
Well if we know the only way to get the blob is from |
|
That's quite similar to what's currently done for Thing Descriptions, although it would need some custom recursive code to cope with outputs that contain Thinking about this some more, I think all of these quirks could be solved if I think it would be fine to make |
|
I think this will be superseded by #244. |
This is very much experimental for comment. Docstrings haven't been updated as we go.
The bug #142 seems to relate to Blobs being cached somewhere and called again by FastAPI without the correct context.
My understanding of how blobs are meant to work
Step 2 is currently done on serialisation as a side effect using a context variable to get the server. This means that serialisation of the basemodel only works in certain contexts which upstream libraries will not expect.
This MR experiments with just saving to the blob manager when the invocation action finishes.