Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the point of this interval? #23

Closed
alexdunk opened this issue Jun 7, 2024 · 2 comments
Closed

What is the point of this interval? #23

alexdunk opened this issue Jun 7, 2024 · 2 comments

Comments

@alexdunk
Copy link

alexdunk commented Jun 7, 2024

This is the solution to fetching files after uploading/deleting or am I missing something?
Why not call fetchFiles after uploading and deleting?

useEffect(() => {
    const interval = setInterval(() => {
      fetchFiles();
    }, 1000);

    return () => clearInterval(interval);
  }, []);
const fetchFiles = async () => {
    const resp = await fetch("/api/assistants/files", {
      method: "GET",
    });
    const data = await resp.json();
    setFiles(data);
  };
@athrael-soju
Copy link

Quickly! Close this issue before someone sees it!

All kidding aside, this is just a quickstart example. I would suggest you use it as a stepping stone to understanding how assistants work internally, but otherwise don't focus too much on the coding practices.

@alexdunk
Copy link
Author

alexdunk commented Jun 8, 2024

okay fair lol

@alexdunk alexdunk closed this as completed Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants