Skip to content

Commit 91635b5

Browse files
Updated instructions about how to send encoded base64 file (#663)
* Practical example about how to send a file using the default API #655 * Updated instructions about how to send a file --------- Co-authored-by: Joe Fernandez <joefernandez@users.noreply.github.com>
1 parent 4155814 commit 91635b5

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/get-started/testing.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,33 @@ data: {"content":{"parts":[{"functionResponse":{"id":"af-f83f8af9-f732-46b6-8cb5
169169

170170
data: {"content":{"parts":[{"text":"OK. The weather in New York is sunny with a temperature of 25 degrees Celsius (41 degrees Fahrenheit).\n"}],"role":"model"},"invocationId":"e-3f6d7765-5287-419e-9991-5fffa1a75565","author":"weather_time_agent","actions":{"stateDelta":{},"artifactDelta":{},"requestedAuthConfigs":{}},"id":"rAnWGSiV","timestamp":1743712257.391317}
171171
```
172+
**Send a query with a base64 encoded file using `/run` or `/run_sse`**
173+
174+
```shell
175+
curl -X POST http://localhost:8000/run \
176+
--H 'Content-Type: application/json' \
177+
--d '{
178+
"appName":"my_sample_agent",
179+
"userId":"u_123",
180+
"sessionId":"s_123",
181+
"newMessage":{
182+
"role":"user",
183+
"parts":[
184+
{
185+
"text":"Describe this image"
186+
},
187+
{
188+
"inlineData":{
189+
"displayName":"my_image.png",
190+
"data":"iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAACXBIWXMAAAsTAAALEwEAmpw...",
191+
"mimeType":"image/png"
192+
}
193+
}
194+
]
195+
},
196+
"streaming":false
197+
}'
198+
```
172199

173200
!!! info
174201

@@ -400,4 +427,4 @@ curl -X POST http://localhost:8000/run_sse \
400427
},
401428
"streaming": false
402429
}'
403-
```
430+
```

0 commit comments

Comments
 (0)