@@ -23,7 +23,10 @@ def test_method_create(self, client: Replicate) -> None:
2323 prediction = client .deployments .predictions .create (
2424 deployment_owner = "deployment_owner" ,
2525 deployment_name = "deployment_name" ,
26- input = {},
26+ input = {
27+ "prompt" : "Tell me a joke" ,
28+ "system_prompt" : "You are a helpful assistant" ,
29+ },
2730 )
2831 assert_matches_type (Prediction , prediction , path = ["response" ])
2932
@@ -33,10 +36,13 @@ def test_method_create_with_all_params(self, client: Replicate) -> None:
3336 prediction = client .deployments .predictions .create (
3437 deployment_owner = "deployment_owner" ,
3538 deployment_name = "deployment_name" ,
36- input = {},
39+ input = {
40+ "prompt" : "Tell me a joke" ,
41+ "system_prompt" : "You are a helpful assistant" ,
42+ },
3743 stream = True ,
38- webhook = "webhook" ,
39- webhook_events_filter = ["start" ],
44+ webhook = "https://example.com/my- webhook-handler " ,
45+ webhook_events_filter = ["start" , "completed" ],
4046 prefer = "wait=5" ,
4147 )
4248 assert_matches_type (Prediction , prediction , path = ["response" ])
@@ -47,7 +53,10 @@ def test_raw_response_create(self, client: Replicate) -> None:
4753 response = client .deployments .predictions .with_raw_response .create (
4854 deployment_owner = "deployment_owner" ,
4955 deployment_name = "deployment_name" ,
50- input = {},
56+ input = {
57+ "prompt" : "Tell me a joke" ,
58+ "system_prompt" : "You are a helpful assistant" ,
59+ },
5160 )
5261
5362 assert response .is_closed is True
@@ -61,7 +70,10 @@ def test_streaming_response_create(self, client: Replicate) -> None:
6170 with client .deployments .predictions .with_streaming_response .create (
6271 deployment_owner = "deployment_owner" ,
6372 deployment_name = "deployment_name" ,
64- input = {},
73+ input = {
74+ "prompt" : "Tell me a joke" ,
75+ "system_prompt" : "You are a helpful assistant" ,
76+ },
6577 ) as response :
6678 assert not response .is_closed
6779 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -78,14 +90,20 @@ def test_path_params_create(self, client: Replicate) -> None:
7890 client .deployments .predictions .with_raw_response .create (
7991 deployment_owner = "" ,
8092 deployment_name = "deployment_name" ,
81- input = {},
93+ input = {
94+ "prompt" : "Tell me a joke" ,
95+ "system_prompt" : "You are a helpful assistant" ,
96+ },
8297 )
8398
8499 with pytest .raises (ValueError , match = r"Expected a non-empty value for `deployment_name` but received ''" ):
85100 client .deployments .predictions .with_raw_response .create (
86101 deployment_owner = "deployment_owner" ,
87102 deployment_name = "" ,
88- input = {},
103+ input = {
104+ "prompt" : "Tell me a joke" ,
105+ "system_prompt" : "You are a helpful assistant" ,
106+ },
89107 )
90108
91109
@@ -98,7 +116,10 @@ async def test_method_create(self, async_client: AsyncReplicate) -> None:
98116 prediction = await async_client .deployments .predictions .create (
99117 deployment_owner = "deployment_owner" ,
100118 deployment_name = "deployment_name" ,
101- input = {},
119+ input = {
120+ "prompt" : "Tell me a joke" ,
121+ "system_prompt" : "You are a helpful assistant" ,
122+ },
102123 )
103124 assert_matches_type (Prediction , prediction , path = ["response" ])
104125
@@ -108,10 +129,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate)
108129 prediction = await async_client .deployments .predictions .create (
109130 deployment_owner = "deployment_owner" ,
110131 deployment_name = "deployment_name" ,
111- input = {},
132+ input = {
133+ "prompt" : "Tell me a joke" ,
134+ "system_prompt" : "You are a helpful assistant" ,
135+ },
112136 stream = True ,
113- webhook = "webhook" ,
114- webhook_events_filter = ["start" ],
137+ webhook = "https://example.com/my- webhook-handler " ,
138+ webhook_events_filter = ["start" , "completed" ],
115139 prefer = "wait=5" ,
116140 )
117141 assert_matches_type (Prediction , prediction , path = ["response" ])
@@ -122,7 +146,10 @@ async def test_raw_response_create(self, async_client: AsyncReplicate) -> None:
122146 response = await async_client .deployments .predictions .with_raw_response .create (
123147 deployment_owner = "deployment_owner" ,
124148 deployment_name = "deployment_name" ,
125- input = {},
149+ input = {
150+ "prompt" : "Tell me a joke" ,
151+ "system_prompt" : "You are a helpful assistant" ,
152+ },
126153 )
127154
128155 assert response .is_closed is True
@@ -136,7 +163,10 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) ->
136163 async with async_client .deployments .predictions .with_streaming_response .create (
137164 deployment_owner = "deployment_owner" ,
138165 deployment_name = "deployment_name" ,
139- input = {},
166+ input = {
167+ "prompt" : "Tell me a joke" ,
168+ "system_prompt" : "You are a helpful assistant" ,
169+ },
140170 ) as response :
141171 assert not response .is_closed
142172 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -153,12 +183,18 @@ async def test_path_params_create(self, async_client: AsyncReplicate) -> None:
153183 await async_client .deployments .predictions .with_raw_response .create (
154184 deployment_owner = "" ,
155185 deployment_name = "deployment_name" ,
156- input = {},
186+ input = {
187+ "prompt" : "Tell me a joke" ,
188+ "system_prompt" : "You are a helpful assistant" ,
189+ },
157190 )
158191
159192 with pytest .raises (ValueError , match = r"Expected a non-empty value for `deployment_name` but received ''" ):
160193 await async_client .deployments .predictions .with_raw_response .create (
161194 deployment_owner = "deployment_owner" ,
162195 deployment_name = "" ,
163- input = {},
196+ input = {
197+ "prompt" : "Tell me a joke" ,
198+ "system_prompt" : "You are a helpful assistant" ,
199+ },
164200 )
0 commit comments