-
Notifications
You must be signed in to change notification settings - Fork 24
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
Create an example setup that works with the basic prompts #83
Comments
That would be most wonderful, I really like repositories with an https://github.com/vercel/next.js/tree/canary/examples
@rajbos thank you for making that suggestion. If you like, you can start by creating the first |
I will! |
I recently shared a minimal hello world example privately within @github. I figured I'll share it here as well, maybe we can use it as a starting point for import { createServer } from "http";
import {
createTextEvent,
createDoneEvent,
} from "@copilot-extensions/preview-sdk";
const server = createServer((req, res) => {
if (req.method === "GET") {
return res.end("ok");
}
res.write(createTextEvent("Hello, world!"));
res.end(createDoneEvent());
});
const PORT = process.env.PORT || 3000;
server.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
}); |
Also here is my own app that I've been using to try out all the SDK capabilities: It's a bit messy but maybe it helps |
That link returns a 404 for me. |
Draft PR started, please comment if you have remarks on the direction it is going. |
sorry it was private, fixed it now |
See the conversation in #83 - Adding `examples` folder with easy to start projects (see `README` in that folder) - Example 1: hello world - Example 2: handle the user prompt by sending it to the Copilot API and returning the result --------- Co-authored-by: Gregor Martynus <[email protected]>
<!-- This pull request template provides suggested sections for framing your work. You're welcome to change or remove headers if it doesn't fit your use case. :) --> ### What are you trying to accomplish? Another example to add from the discussion in #83 ### What approach did you choose and why? Adding a full example how to create the user confirmation and handling the response, for easier exploration. ### What should reviewers focus on? If things fit the right way, happy to adjust when needed 😄
It was quite a hassle to get things started with the SDK, I think it would make it a lot easier if an
example
folder is included that can be executed, basically with the example of 'Talk like a pirate'.I'd be happy to help out with that, either in this repo or in a new one?
We can also include an example of running this inside of a Codespace, which works rather nicely. A walk trough would really help there as well.
Let me know your thoughts and I can help out with setting things up.
The text was updated successfully, but these errors were encountered: