createTakoClient(apiKey)
Creates a new Tako API client.
apiKey(string): Your Tako API key
takoClient.knowledgeSearch(text, sourceIndexes?)
Search Tako Knowledge using natural language.
text(string): The natural language query textsourceIndexes(SourceIndex[], optional): Array of source indexes to search within. Available values:SourceIndex.TAKOorSourceIndex.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 card
Error Handling
The SDK throws typed exceptions for different errors:status: HTTP status codemessage: Error messagedetails: Additional error details from the API (if available)