tool-input-available.tsx 738 B

12345678910111213141516171819202122232425262728293031
  1. "use client";
  2. import { Tool, ToolContent, ToolHeader, ToolInput } from "@/components/ai-elements/tool";
  3. import { nanoid } from "nanoid";
  4. const toolCall = {
  5. errorText: undefined,
  6. input: {
  7. prompt: "A futuristic cityscape at sunset with flying cars",
  8. quality: "high",
  9. resolution: "1024x1024",
  10. style: "digital_art",
  11. },
  12. output: undefined,
  13. state: "input-available" as const,
  14. toolCallId: nanoid(),
  15. type: "tool-image_generation" as const,
  16. };
  17. const Example = () => (
  18. <div style={{ height: "500px" }}>
  19. <Tool>
  20. <ToolHeader state={toolCall.state} type={toolCall.type} />
  21. <ToolContent>
  22. <ToolInput input={toolCall.input} />
  23. </ToolContent>
  24. </Tool>
  25. </div>
  26. );
  27. export default Example;