Skip to content

Commit 3681c86

Browse files
committed
update response
1 parent bae3acf commit 3681c86

File tree

1 file changed

+75
-2
lines changed

1 file changed

+75
-2
lines changed

src/content/docs/autorag/usage/workers-binding.mdx

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,44 @@ const answer = await env.AI.autorag("my-autorag").aiSearch({
5353

5454
This is the response structure without `stream` enabled.
5555

56-
<Render file="ai-search-response" product="autorag" />
56+
```sh output
57+
{
58+
"object": "vector_store.search_results.page",
59+
"search_query": "How do I train a llama to deliver coffee?",
60+
"response": "To train a llama to deliver coffee:\n\n1. **Build trust** — Llamas appreciate patience (and decaf).\n2. **Know limits** — Max 3 cups per llama, per `llama-logistics.md`.\n3. **Use voice commands** — Start with \"Espresso Express!\"\n4.",
61+
"data": [
62+
{
63+
"file_id": "llama001",
64+
"filename": "docs/llama-logistics.md",
65+
"score": 0.98,
66+
"attributes": {},
67+
"content": [
68+
{
69+
"id": "llama001",
70+
"type": "text",
71+
"text": "Llamas can carry 3 drinks max."
72+
}
73+
]
74+
},
75+
{
76+
"file_id": "llama042",
77+
"filename": "docs/llama-commands.md",
78+
"score": 0.95,
79+
"attributes": {},
80+
"content": [
81+
{
82+
"id": "llama042",
83+
"type": "text",
84+
"text": "Start with basic commands like 'Espresso Express!' Llamas love alliteration."
85+
}
86+
]
87+
},
88+
],
89+
"has_more": false,
90+
"next_page": null
91+
}
92+
93+
```
5794

5895
## `search()`
5996

@@ -76,7 +113,43 @@ const answer = await env.AI.autorag("my-autorag").search({
76113

77114
### Response
78115

79-
<Render file="search-response" product="autorag" />
116+
```sh output
117+
{
118+
"object": "vector_store.search_results.page",
119+
"search_query": "How do I train a llama to deliver coffee?",
120+
"data": [
121+
{
122+
"file_id": "llama001",
123+
"filename": "docs/llama-logistics.md",
124+
"score": 0.98,
125+
"attributes": {},
126+
"content": [
127+
{
128+
"id": "llama001",
129+
"type": "text",
130+
"text": "Llamas can carry 3 drinks max."
131+
}
132+
]
133+
},
134+
{
135+
"file_id": "llama042",
136+
"filename": "docs/llama-commands.md",
137+
"score": 0.95,
138+
"attributes": {},
139+
"content": [
140+
{
141+
"id": "llama042",
142+
"type": "text",
143+
"text": "Start with basic commands like 'Espresso Express!' Llamas love alliteration."
144+
}
145+
]
146+
},
147+
],
148+
"has_more": false,
149+
"next_page": null
150+
}
151+
152+
```
80153

81154
## Local development
82155

0 commit comments

Comments
 (0)