Elmar

Expo, AI Structured Output

Aug 27, 2024

UseObject is a hook to handle streamed structured output from an Api. This way we can handle real-time updates from OpenAi for example. It also supports passing an id for calling the hook in one place and rendering the results in other.

      import {  } from "./schema";
import {  } from "./use-object";

export const  = () => {
  const { , , ,  } = ({
    : "/api/receipt",
    : ,
    : ({ ,  }) => {
        .
}, }); //... };