Skip to content

Commit 5da1e6d

Browse files
authored
docs: add documentation for eval_async() (#520)
* docs: add documentation for `eval_async()` * style: minor words
1 parent 6a0bbbc commit 5da1e6d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/docs/query.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In this case, you can:
3131

3232
3. At query time, you usually want to directly run the function with specific input data, instead of letting it called as part of a long-lived indexing flow.
3333
To do this, declare the function as a *transform flow*, by decorating it with `@cocoindex.transform_flow()`.
34-
This will add a `eval()` method to the function, so that you can directly call with specific input data.
34+
This will add `eval()` and `eval_async()` methods to the function, so that you can directly call with specific input data.
3535

3636

3737
<Tabs>
@@ -67,6 +67,12 @@ Any time, you can call the `eval()` method with specific string, which will retu
6767
print(text_to_embedding.eval("Hello, world!"))
6868
```
6969

70+
If you're in an async context, please call the `eval_async()` method instead:
71+
72+
```python
73+
print(await text_to_embedding.eval_async("Hello, world!"))
74+
```
75+
7076
</TabItem>
7177
</Tabs>
7278

0 commit comments

Comments
 (0)