mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-24 20:09:02 +00:00
fix(search): point native Hanzo search/index client at the live /v1 API
The native 'hanzo' search + sync clients defaulted to dead endpoints (cloud-api.hanzo.ai/api/search-docs, api.cloud.hanzo.ai/api/index-docs). Repoint to the live hanzoai/ai gateway (verified vs routers/router.go): search -> https://api.hanzo.ai/v1/search, index -> https://api.hanzo.ai/v1/index. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -4,17 +4,17 @@ export interface HanzoSearchOptions {
|
||||
/**
|
||||
* The Hanzo Search API endpoint.
|
||||
*
|
||||
* For `backend: 'cloud'` (default): the cloud-api search-docs URL.
|
||||
* For `backend: 'cloud'` (default): the Hanzo AI `/v1/search` URL.
|
||||
* For `backend: 'meilisearch'`: the Meilisearch base URL (e.g. 'https://search.hanzo.ai').
|
||||
*
|
||||
* @defaultValue 'https://cloud-api.hanzo.ai/api/search-docs'
|
||||
* @defaultValue 'https://api.hanzo.ai/v1/search'
|
||||
*/
|
||||
endpoint?: string;
|
||||
|
||||
/**
|
||||
* Search backend to use.
|
||||
*
|
||||
* - `'cloud'`: Hanzo cloud-api `/api/search-docs` endpoint.
|
||||
* - `'cloud'`: Hanzo AI `/v1/search` endpoint.
|
||||
* - `'meilisearch'`: Direct Meilisearch instance (requires `index`).
|
||||
*
|
||||
* @defaultValue 'cloud'
|
||||
@@ -128,7 +128,7 @@ export async function searchDocs(
|
||||
options: HanzoSearchOptions,
|
||||
): Promise<SortedResult[]> {
|
||||
const {
|
||||
endpoint = 'https://cloud-api.hanzo.ai/api/search-docs',
|
||||
endpoint = 'https://api.hanzo.ai/v1/search',
|
||||
backend = 'cloud',
|
||||
index = 'app-docs-hanzo-ai-docs',
|
||||
apiKey,
|
||||
|
||||
@@ -59,17 +59,17 @@ export interface HanzoSyncOptions {
|
||||
/**
|
||||
* The index API endpoint.
|
||||
*
|
||||
* For `backend: 'cloud'`: the cloud-api index-docs URL.
|
||||
* For `backend: 'cloud'`: the Hanzo AI `/v1/index` URL.
|
||||
* For `backend: 'meilisearch'`: the Meilisearch base URL (e.g. 'https://search.hanzo.ai').
|
||||
*
|
||||
* @defaultValue 'https://api.cloud.hanzo.ai/api/index-docs'
|
||||
* @defaultValue 'https://api.hanzo.ai/v1/index'
|
||||
*/
|
||||
endpoint?: string;
|
||||
|
||||
/**
|
||||
* Sync backend to use.
|
||||
*
|
||||
* - `'cloud'`: Hanzo cloud-api `/api/index-docs` endpoint.
|
||||
* - `'cloud'`: Hanzo AI `/v1/index` endpoint.
|
||||
* - `'meilisearch'`: Direct Meilisearch instance (requires `index`).
|
||||
*
|
||||
* @defaultValue 'cloud'
|
||||
@@ -235,7 +235,7 @@ async function waitForTask(
|
||||
|
||||
export async function sync(options: HanzoSyncOptions): Promise<void> {
|
||||
const {
|
||||
endpoint = 'https://api.cloud.hanzo.ai/api/index-docs',
|
||||
endpoint = 'https://api.hanzo.ai/v1/index',
|
||||
backend = 'cloud',
|
||||
index: indexName = 'app-docs-hanzo-ai-docs',
|
||||
apiKey,
|
||||
|
||||
Reference in New Issue
Block a user