Skip to content

Conversation

@MaesterChestnut
Copy link
Contributor

Adding in a few flows for developers to try streaming, history, and image input quickly

image

pnpm build
```

or if you need to, build everything:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can set this up as a prerequisite step (build the entire repo first) that we note can be skipped if already done. otherwise, how does one answer the question "build if you need to?"

},
async (subject) => {
const { response, stream } = await generateStream({
prompt: `Suggest many items for the menu of a ${subject} themed restaurant`,
Copy link
Member

Choose a reason for hiding this comment

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

maybe specify exactly how many, or provide a range?

},
async (subject) => {
// lets do few-shot examples: generate a few different generations, keep adding the history
// before generating an item for the menu of a themed restaurant
Copy link
Member

Choose a reason for hiding this comment

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

Since this is actually going to call the model, it's probably not a good example of a "few-shot" prompt, which would typically have hardcoded examples.

Copy link
Member

@MichaelDoyle MichaelDoyle May 10, 2024

Choose a reason for hiding this comment

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

This looks more like a pre-scripted chat exchange, but will still be non-deterministic. We should probably talk through more what you want to be the outcome here.


for await (let chunk of stream()) {
for (let content of chunk.content) {
console.log(content.text);
Copy link
Contributor

@tagboola tagboola May 10, 2024

Choose a reason for hiding this comment

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

Consider passing the contents of the chunk to the streamingCallback if it's defined.

}
);

let historyMap: MessageData[] = sampleMenuHistory;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Drop the Map since it's an array

@MaesterChestnut MaesterChestnut marked this pull request as draft May 13, 2024 14:45
@MaesterChestnut MaesterChestnut deleted the menu/generationExample branch July 8, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants