> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Hub SDK Reference

> SDK reference for the Hub API, available in Node.js and Python.

## Hub

### Search Hub

Returns hub items available to the current workspace, sorted by display name.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.hub.search()

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.hub.search();

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "q": Optional[str],
        "types": List[str],  # optional
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      q?: string;
      types?: string[];
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "hits": [{
            "document": {
                "id": str,
                "entity_id": Optional[str],
                "display_name": str,
                "description": str,
                "type": str,
            },
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      hits: {
        document: {
          id: string;
          entityId?: string;
          displayName: string;
          description: string;
          type: string;
        };
      }[];
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a Hub

Retrieves a hub item available to the current workspace.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.hub.get(id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.hub.get({
      id: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "hub_item": {
            "id": Optional[str],
            "entity_id": str,
            "display_name": str,
            "description": str,
            "type": str,
            "is_active": Optional[bool],
            "is_private": Optional[bool],
            "is_provided_by_orq": Optional[bool],
            "engine": Optional[str],
            "key": Optional[str],
            "evaluator": Dict[str, Any],  # optional
            "prompt": Dict[str, Any],  # optional
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      hubItem: {
        id?: string;
        entityId: string;
        displayName: string;
        description: string;
        type: string;
        isActive?: boolean;
        isPrivate?: boolean;
        isProvidedByOrq?: boolean;
        engine?: string;
        key?: string;
        evaluator?: Record<string, unknown>;
        prompt?: Record<string, unknown>;
      };
    }
    ```
  </CodeGroup>
</Expandable>
