Chainlit / cookbook

Chainlit's cookbook repo
https://github.com/Chainlit/chainlit
713 stars 270 forks source link

OpenAI assistant example #40

Closed ryanshrott closed 9 months ago

ryanshrott commented 9 months ago
  1. images not working: 'MessageContentImageFile' object has no attribute 'text'

  2. Show all steps please with code interpreter

  3. Enable streaming.

willydouhard commented 9 months ago

Can you explain the procedure to reproduce the error with MessageContentImageFile ?

ryanshrott commented 9 months ago

make a plot of f(x)=x^3

ryanshrott commented 9 months ago

also, some of the markdown for equations is not being displayed properly. although maybe there is nothing that can be done?

Try running: Prove that √2 is irrational.

The result: The irrationality of (\sqrt{2}) can be shown using a proof by contradiction. Here’s a classic proof:

Assume, for the sake of contradiction, that (\sqrt{2}) is rational. This means it can be expressed as a fraction (\frac{a}{b}) in its simplest form (where (a) and (b) are integers that have no common factors other than 1 and (b) is not zero).

According to our assumption, (\left(\frac{a}{b}\right)^2 = 2), which implies that (a^2 = 2b^2).

From (a^2 = 2b^2), we see that (a^2) is even (because it's equal to two times a square number). This implies that (a) is also even (because the square of an odd number is odd).

Because (a) is even, there exists an integer (k) such that (a = 2k).

Substituting (2k) for (a) in the equation (a^2 = 2b^2) yields ((2k)^2 = 2b^2), which simplifies to (4k^2 = 2b^2) and further to (2k^2 = b^2).

Now, from (2k^2 = b^2), we can see that (b^2) is even, hence (b) must also be even.

Since both (a) and (b) are even, they have a common factor of 2.

This contradicts our initial condition that (\frac{a}{b}) is in its simplest form (no common factors other than 1).

Hence, our assumption that (\sqrt{2}) is rational is false.

Therefore, we have proved by contradiction that (\sqrt{2}) is irrational.

willydouhard commented 9 months ago

Thanks! Will take a look

willydouhard commented 9 months ago

I have updated the cookbook example (including the assistant instructions).

Screenshot 2023-11-09 at 13 41 08 Screenshot 2023-11-09 at 13 40 11

These results are only achievable with this version of Chainlit . Will try to make a RC release today.

willydouhard commented 9 months ago

Just updated the cookbook example to display messages as they go. Check the video.

ryanshrott commented 9 months ago

thanks is it on pypi yet?

willydouhard commented 9 months ago

yes, run pip install --pre chainlit

ryanshrott commented 9 months ago

@willydouhard the latex and formulas are not being formatted properly. Are you sure that issue is resolved? Try running:

Find circ of circle

willydouhard commented 9 months ago

What version of chainlit do you use? In the latest one, latex is disabled by default.

ryanshrott commented 9 months ago

Latest version. How to enable it?

On Thu, Nov 30, 2023 at 3:19 PM Willy Douhard @.***> wrote:

What version of chainlit do you use? In the latest one, latex is disabled by default.

— Reply to this email directly, view it on GitHub https://github.com/Chainlit/cookbook/issues/40#issuecomment-1834486077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGNYNRIFBMP5DNFCF5RF7TYHDS4RAVCNFSM6AAAAAA7DOZGRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGQ4DMMBXG4 . You are receiving this because you authored the thread.Message ID: @.***>

ryanshrott commented 9 months ago

@willydouhard im on latest. How to enable it?

willydouhard commented 9 months ago

In your config.toml file under feature

ryanshrott commented 9 months ago

Thanks