You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A `spec` field must be present in the class, and must be annoated with the spec class name.
76
94
* The `prepare()` method is optional. It's executed once and only once before any `__call__` execution, to prepare the function execution.
77
95
* The `__call__()` method is required. It's executed for each specific rows of data.
78
96
Types of arugments and the return value must be annotated, so that CocoIndex will have information about data types of the operation's output fields. See [Data Types](/docs/core/data_types) for supported types.
79
97
80
98
</TabItem>
81
-
</Tabs>
99
+
</Tabs>
100
+
101
+
## Examples
102
+
103
+
The cocoindex repository contains the following examples of custom functions:
104
+
105
+
* In the [pdf_embedding](https://github.com/cocoindex-io/cocoindex/blob/main/examples/pdf_embedding/pdf_embedding.py) example, we define a custom function `PdfToMarkdown`
106
+
* The `SentenceTransformerEmbed` function shipped with the CocoIndex Python package is defined by Python SDK.
107
+
Search for [`SentenceTransformerEmbedExecutor`](https://github.com/search?q=repo%3Acocoindex-io%2Fcocoindex+SentenceTransformerEmbedExecutor&type=code) to see the code.
0 commit comments