KnowledgeSearch Parameters
query: str
The natural language query string.
Example:
query = "what's the msft stock price today?"
source_indexes: Optional[List[KnowledgeSearchSourceIndex]]
Controls the priority of sources searched. If results are found in the first index, the search stops.
Valid values:
KnowledgeSearchSourceIndex.TAKO
KnowledgeSearchSourceIndex.WEB
Default: [KnowledgeSearchSourceIndex.TAKO]
Response
The response is a KnowledgeSearchResults
object containing:
request_id
: Unique ID for the request
outputs.knowledge_cards
: A list of knowledge cards. Each includes:
title
description
webpage_url
image_url
embed_url
sources
and methodologies
You can render them, embed them, or redirect to the webpage URL.
Example Response
KnowledgeSearchResults(
outputs=KnowledgeSearchOutputs(
knowledge_cards=[
KnowledgeCard(
card_id='dnjTI20unRq_q13PX4Am',
title='Microsoft Stock Overview',
description='Microsoft stock price is 435.20 at 2025-05-02T21:40:00+00:00 for ticker MSFT...',
webpage_url='https://trytako.com/card/dnjTI20unRq_q13PX4Am/',
image_url='https://trytako.com/api/v1/image/dnjTI20unRq_q13PX4Am/',
embed_url='https://trytako.com/embed/dnjTI20unRq_q13PX4Am/',
sources=[
KnowledgeCardSource(source_name='S&P Global', ...),
KnowledgeCardSource(source_name='Xignite', ...)
],
methodologies=[
KnowledgeCardMethodology(methodology_name='Where the Data Comes From - S&P Global', ...),
KnowledgeCardMethodology(methodology_name='Where the Data Comes From - Xignite', ...)
],
source_indexes=[KnowledgeSearchSourceIndex.TAKO]
)
]
),
request_id='ab06f02c-8139-4166-b978-639cba618823'
)