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
By default `use()` knows nothing about the interface of the model. To provide a better developer experience we provide two methods to add type annotations to the function returned by the `use()` helper.
598
+
599
+
**1. Provide a function signature**
600
+
601
+
The use method accepts a function signature as an additional `hint` keyword argument. When provided it will use this signature for the `model()` and `model.create()` functions.
602
+
603
+
```py
604
+
# Flux takes a required prompt string and optional image and seed.
output1 = flux_dev() # will warn that `prompt` is missing
624
+
output2 = flux_dev(prompt="str") # output2 will be typed as `str`
625
+
```
626
+
627
+
In future we hope to provide tooling to generate and provide these models as packages to make working with them easier. For now you may wish to create your own.
628
+
595
629
### TODO
596
630
597
631
There are several key things still outstanding:
598
632
599
633
1. Support for asyncio.
600
-
2. Support for typing the return value.
601
-
3. Support for streaming text when available (rather than polling)
602
-
4. Support for streaming files when available (rather than polling)
603
-
5. Support for cleaning up downloaded files.
604
-
6. Support for streaming logs using `OutputIterator`.
634
+
2. Support for streaming text when available (rather than polling)
635
+
3. Support for streaming files when available (rather than polling)
636
+
4. Support for cleaning up downloaded files.
637
+
5. Support for streaming logs using `OutputIterator`.
0 commit comments