File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ seedream = replicate.use("bytedance/seedream-4")
4040veo = replicate.use(" google/veo-3-fast" )
4141
4242# Enhance a simple prompt
43- image_prompt = claude(prompt = " bananas wearing cowboy hats" , system_prompt = " turn prompts into image prompts" )
43+ image_prompt = claude(
44+ prompt = " bananas wearing cowboy hats" , system_prompt = " turn prompts into image prompts"
45+ )
4446
4547# Generate an image from the enhanced prompt
4648images = seedream(prompt = image_prompt)
@@ -59,9 +61,7 @@ The library uses the `REPLICATE_API_TOKEN` environment variable by default to im
5961import os
6062from replicate import Replicate
6163
62- client = Replicate(
63- bearer_token = os.environ.get(" REPLICATE_API_TOKEN" )
64- )
64+ client = Replicate(bearer_token = os.environ.get(" REPLICATE_API_TOKEN" ))
6565```
6666
6767## Using ` replicate.use() `
Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ def test_stream_returns_iterator():
101101
102102def test_stream_works_same_as_use_with_streaming ():
103103 """Test that stream() produces the same output as use() with streaming=True."""
104- with patch ("replicate.lib._stream.use" ) as mock_stream_use , \
105- patch ("replicate.lib._predictions_use.use" ) as mock_predictions_use :
104+ with patch ("replicate.lib._stream.use" ) as mock_stream_use , patch (
105+ "replicate.lib._predictions_use.use"
106+ ) as mock_predictions_use :
106107 # Create a mock function that returns an iterator
107108 mock_function = Mock ()
108109 expected_output = ["Test" , " " , "output" ]
You can’t perform that action at this time.
0 commit comments