createTakoClient(apiKey)
apiKey
(string): Your Tako API keytakoClient.knowledgeSearch(text, sourceIndexes?)
text
(string): The natural language query textsourceIndexes
(SourceIndex[], optional): Array of source indexes to search within. Available values: SourceIndex.TAKO
or SourceIndex.WEB
Promise<KnowledgeSearchResponse>
The response contains an array of knowledge cards in the outputs.knowledge_cards
field. Each knowledge card contains:
card_id
: Unique identifier for the cardtitle
: Card titledescription
: Detailed description of the card’s contentwebpage_url
: URL of a webpage hosting the interactive knowledge cardimage_url
: URL of a static image of the knowledge cardembed_url
: URL of an embeddable iframe of the knowledge cardsources
: The sources of the knowledge cardmethodologies
: The methodologies of the knowledge cardstatus
: HTTP status codemessage
: Error messagedetails
: Additional error details from the API (if available)