{
  "/query_docs": {
    "description": "Query the indexer for documents.",
    "args": {
      "request": {
        "type": {
          "type": "model",
          "name": "IndexerRequest",
          "schema": {
            "description": "Request to the indexer service to retrieve documents for a given query.",
            "properties": {
              "query": {
                "description": "The query to the indexer service",
                "title": "Query",
                "type": "string"
              },
              "k": {
                "default": 5,
                "description": "The number of documents to retrieve",
                "title": "K",
                "type": "integer"
              }
            },
            "required": [
              "query"
            ],
            "title": "IndexerRequest",
            "type": "object"
          }
        },
        "required": true
      }
    },
    "returns": {
      "type": "model",
      "name": "IndexerRetrievalResponse",
      "schema": {
        "$defs": {
          "RetrievedDoc": {
            "description": "A document retrieved from the indexer service.",
            "properties": {
              "text": {
                "description": "The text of the document",
                "title": "Text",
                "type": "string"
              },
              "link": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The link to the document",
                "title": "Link"
              },
              "img_url": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The image URL of the document",
                "title": "Img Url"
              },
              "title": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The title of the document",
                "title": "Title"
              },
              "metadata": {
                "description": "Additional metadata",
                "title": "Metadata",
                "type": "object"
              },
              "score": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The relevance score of the document",
                "title": "Score"
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "description": "The source of the document",
                "title": "Source"
              }
            },
            "required": [
              "text"
            ],
            "title": "RetrievedDoc",
            "type": "object"
          }
        },
        "description": "Response from the indexer service containing the retrieved documents.",
        "properties": {
          "query": {
            "description": "The original query to the indexer service",
            "title": "Query",
            "type": "string"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "The source of the documents",
            "title": "Source"
          },
          "results": {
            "description": "The retrieved documents",
            "items": {
              "$ref": "#/$defs/RetrievedDoc"
            },
            "title": "Results",
            "type": "array"
          },
          "err_message": {
            "default": "",
            "description": "Error message if any",
            "title": "Err Message",
            "type": "string"
          }
        },
        "required": [
          "query",
          "results"
        ],
        "title": "IndexerRetrievalResponse",
        "type": "object"
      }
    }
  }
}