Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 25, 2025

Closes #3191

Copy link

cloudflare-workers-and-pages bot commented Sep 25, 2025

Deploying wasp-docs-on-main with  Cloudflare Pages  Cloudflare Pages

Latest commit: beb5026
Status: ✅  Deploy successful!
Preview URL: https://fc3925b9.wasp-docs-on-main.pages.dev
Branch Preview URL: https://copilot-fix-0b836315-72b9-4d.wasp-docs-on-main.pages.dev

View logs

@Copilot Copilot AI changed the title [WIP] Streaming responses using custom APIs Add comprehensive streaming responses documentation to Custom HTTP API Endpoints Sep 25, 2025
@Copilot Copilot AI requested a review from infomiho September 25, 2025 14:24
Copilot finished work on behalf of infomiho September 25, 2025 14:24
@infomiho
Copy link
Contributor

@copilot Don't worry about the versioned docs, I'll take care of it. Let's mention the use case of streaming responses from LLMs - common these days. Let's make sure to use auto-js instead of duplicating TS/JS code. Make sure the language is very simple and adheres to the Wasp's writing guide: https://wasp.sh/docs/writingguide

Copy link
Contributor Author

Copilot AI commented Sep 25, 2025

@copilot Don't worry about the versioned docs, I'll take care of it. Let's mention the use case of streaming responses from LLMs - common these days. Let's make sure to use auto-js instead of duplic...

Updated the streaming documentation to address your feedback! Changes in commit af4b450:

✅ Added LLM use case prominently in the introduction - now highlights streaming AI-generated content like ChatGPT
✅ Replaced ShowForTs/ShowForJs sections with single auto-js code blocks to avoid duplication
✅ Simplified language throughout following the writing guide principles
✅ Removed versioned docs changes as requested - left for you to handle

The documentation now uses simpler, more direct language and showcases modern streaming use cases. The examples are consolidated using auto-js for cleaner maintenance.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • wasp.sh
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI changed the title Add comprehensive streaming responses documentation to Custom HTTP API Endpoints Add streaming responses documentation with LLM use cases to Custom HTTP API Endpoints Sep 25, 2025
Copilot finished work on behalf of infomiho September 25, 2025 14:59
Copy link
Contributor

@infomiho infomiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I've left you a review. Please address the comments and remove the extra file apis_test.md

@Copilot Copilot AI changed the title Add streaming responses documentation with LLM use cases to Custom HTTP API Endpoints Add comprehensive streaming responses documentation to Custom HTTP API Endpoints Sep 26, 2025
@Copilot Copilot AI requested a review from infomiho September 26, 2025 09:59
Copilot finished work on behalf of infomiho September 26, 2025 09:59
Copilot finished work on behalf of infomiho September 26, 2025 10:05
@Copilot Copilot AI requested a review from infomiho September 26, 2025 10:05
@infomiho infomiho force-pushed the copilot/fix-0b836315-72b9-4d91-94c9-4a9819f9b3c3 branch 2 times, most recently from 589a2e1 to 8fc3098 Compare September 26, 2025 10:33
@infomiho infomiho marked this pull request as ready for review September 26, 2025 10:36
Copy link
Member

@cprecioso cprecioso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally ok, some suggestions:

@infomiho
Copy link
Contributor

@copilot address the comments by @cprecioso leave out the "I'd add a more relevant example here." comment, I'll deal with that one myself

Copy link
Contributor Author

Copilot AI commented Sep 26, 2025

@copilot address the comments by @cprecioso leave out the "I'd add a more relevant example here." comment, I'll deal with that one myself

Addressed all @cprecioso's suggestions in commit dd86ed4:

Import cleanup: Removed unused React import from both examples
Function signature: Removed unused _context parameter
AbortController pattern: Moved to highest level, pass only AbortSignal down
Modern streaming: Used for await...of loop instead of manual reader

Left out the "more relevant example" comment as requested - that one is yours to handle.

Copilot finished work on behalf of infomiho September 26, 2025 15:27
Copilot AI and others added 7 commits September 29, 2025 16:44
…I Endpoints

Co-authored-by: infomiho <2223680+infomiho@users.noreply.github.com>
Co-authored-by: infomiho <2223680+infomiho@users.noreply.github.com>
…organization

Co-authored-by: infomiho <2223680+infomiho@users.noreply.github.com>
Co-authored-by: infomiho <2223680+infomiho@users.noreply.github.com>
Co-authored-by: infomiho <2223680+infomiho@users.noreply.github.com>
@infomiho infomiho force-pushed the copilot/fix-0b836315-72b9-4d91-94c9-4a9819f9b3c3 branch from d4a5c5c to b908ad8 Compare September 29, 2025 14:44
@infomiho infomiho requested a review from cprecioso September 29, 2025 15:18
Copy link
Member

@cprecioso cprecioso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approving since I think you forgot to push some changes

}
```

#### Using Axios
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to show users how to do it with fetch and with axios? I think we can remove the axios section tbh (being that fetch is lighter and more modern). Or at the very least, tell the user why they'd want to use axios instead of fetch and vice-versa.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an api with auth provided that users can just import and that's what we push them to use for custom HTTP endpoints. Since Axios doesn't support streaming responses, we introduce fetch here for the first time in our examples, ever. So I wanted to also give them an option if they want to stick with Axios. I guess the way forward would be to upgrade our internal API not to use Axios and to use something fetch based e.g. https://github.com/suhaotian/xior

Copy link
Member

@cprecioso cprecioso Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is mentioned in #2935

As I said, at least I would mention why users should take one or other.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought was currently written explains that:

  • downside: Axios does not natively support streaming responses
  • upside: you don't have to provide the session token manually, as the Axios wrapper from wasp/client/api does that for you.

Should I add something else here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm IMO that is just a description but that doesn't provide clear guidance. I think we should focus on when are this downsides or upsides important for me?

Anyway it's quite a small thing so accepting, whatever you choose is good.

}
```

#### Using Axios
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm IMO that is just a description but that doesn't provide clear guidance. I think we should focus on when are this downsides or upsides important for me?

Anyway it's quite a small thing so accepting, whatever you choose is good.

@infomiho
Copy link
Contributor

infomiho commented Oct 1, 2025

Updated the wording to better explain the trade-offs between fetch and Axios 😄

@infomiho infomiho requested a review from cprecioso October 1, 2025 11:37
@infomiho infomiho merged commit b0acb69 into main Oct 1, 2025
3 checks passed
@infomiho infomiho deleted the copilot/fix-0b836315-72b9-4d91-94c9-4a9819f9b3c3 branch October 1, 2025 11:51
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

Successfully merging this pull request may close these issues.

Streaming responses using custom APIs

3 participants