Sections

Get matching sections

1GET https://api.markprompt.com/sections

Retrieves a list of sections that match a prompt.

The /sections endpoint is available as part of the Enterprise plan.

Request body

KeyTypeDescription
promptstringThe input prompt.
sectionsMatchCountnumberThe number of sections to retrieve. Default: 10.
sectionsMatchThresholdnumberThe similarity threshold between the input prompt and selected sections. The higher the threshold, the more relevant the sections. If it's too high, it can potentially miss some sections. Default: 0.5.
maxContextTokensnumberThe maximum number of tokens that the returned sections fill. Default: 10000.
ragTypebasic | smallToBigThe RAG strategy. If set to basic, sections whose embeddings satisfy the minimum similarity score against the input prompt are returned. If set to smallToBig, search for section matches is extended to include neighboring content, as long as it fits within the maxContentTokens constraint. Note that smallToBig RAG type is an enterprise-only feature

Example request

1curl "https://api.markprompt.com/sections?prompt=what%20is%20a%20component%3F&sectionsMatchCount=20&sectionsMatchThreshold=0.4" \
2  -X GET \
3  -H "Authorization: Bearer <TOKEN>" \
4  -H "Content-type: application/json" \
5  -H "Accept: application/json" \
6  -H "X-Markprompt-API-Version: 2024-03-23"

Response

The response is of the form:

1{
2  data: [
3    {
4      path: "/path/to/section/1",
5      content: "Section 1 content...",
6      similarity: 0.89
7    },
8    {
9      path: "/path/to/section/2",
10      content: "Section 2 content...",
11      similarity: 0.72
12    },
13    ...
14  ]
15}