vizovitin / foundryvtt-ask-chatgpt

Customizable ChatGPT integration for Foundry VTT
https://foundryvtt.com/packages/ask-chatgpt
MIT License
4 stars 6 forks source link

High token usage? #13

Open Andreanoceras opened 10 months ago

Andreanoceras commented 10 months ago

Hello! I calculated the token usage with openai tool and it say that text provided as input and output should be around 150 tokens but instead in chatgpt ai usage it says it's around 4000 tokens.

Do you have any ipothesis about? Thank you!

vizovitin commented 10 months ago

Please provide specific steps to reproduce, including any history you might have used. Note that history is included into the context (see "Context length" in the settings).

Andreanoceras commented 10 months ago

Hi Nikolay! First of all, this implementation is absolutely amazing! I'm a solo roleplayer and being able to use chatgpt directly in foundryvtt as a dungeon master it's absolutely incredible. It would be great maybe next releases to use dall-e to generate also image preview of what described.

I think that Context Length is taking most of the tokens because I set it to maximum value, 50. Because letting gpt access to previous messages give incredible result in narrating a coherent and cohesive story. I switched back to gpt 3.5 from 4 due the high cost of tokens (I spent almost 5$ in an hour) and if even it's a previous iteration it's giving good answers nonetheless.

Would you suggest using gpt-4 with low contex length value or maximize it and use gpt 3.5?

Thank you!

Il giorno ven 27 ott 2023 alle ore 13:41 Nikolay Vizovitin < @.***> ha scritto:

Please provide specific steps to reproduce, including any history you might have used. Note that history is included into the context (see "Context length" in the settings).

— Reply to this email directly, view it on GitHub https://github.com/vizovitin/foundryvtt-ask-chatgpt/issues/13#issuecomment-1782769926, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDRUX2SXQ5DRV3WL6GJ2YULYBOMW7AVCNFSM6AAAAAA6RZXUYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSG43DSOJSGY . You are receiving this because you authored the thread.Message ID: @.***>

vizovitin commented 10 months ago

Depends on your specific usage and experience with both models. But in majority of cases gpt-3.5 is sufficiently good, so it should be a good starting point. I suggest switching to gpt-4 only if you see specific use cases valuable to you where it performs noticeably better.

Andreanoceras commented 10 months ago

Do you have any platform where I could leave a little tip?

Il Ven 27 Ott 2023, 18:52 Nikolay Vizovitin @.***> ha scritto:

Depends on your specific usage and experience with both models. But in majority of cases gpt-3.5 is sufficiently good, so it should be a good starting point. I suggest switching to gpt-4 only if you see specific use cases valuable to you where it performs noticeably better.

— Reply to this email directly, view it on GitHub https://github.com/vizovitin/foundryvtt-ask-chatgpt/issues/13#issuecomment-1783222822, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDRUX2RAIZNRYRSKARJCG2LYBPRETAVCNFSM6AAAAAA6RZXUYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTGIZDEOBSGI . You are receiving this because you authored the thread.Message ID: @.***>

vizovitin commented 10 months ago

I've set up one at https://ko-fi.com/vizovitin . I'll link it to the repo some time later.

Feel free to use it, but please don't consider yourself in any way obligated to.

I know your use case is slightly different from what I personally use the module for (inspiration source and on-the-fly generation of various tidbits while I GM, as well as rules "reference" to a much lesser extent), so if you have any insight into what works well/poorly for you, it would be much appreciated.

Andreanoceras commented 10 months ago

Hi Nikolay!

I've been trying to pay on ko-fi but every times I get an error message. Do you have a paypal account?

Also, the only problem I find with chatgpt is, even if i set 50 message before, sometimes it play extremely well and sometimes it's like the first time i'm chatting with (expecially after some day, don't know if it's because it auto-resets).

PS: this is a bit off topic, but i'm starting to learn how to program (with python) so if you have any tip or need any kind of help feel free to let me know. I'd like to do some hands-on, on real use cases so... thank you!

Il giorno mer 1 nov 2023 alle ore 23:17 Nikolay Vizovitin < @.***> ha scritto:

I've set up one at https://ko-fi.com/vizovitin . I'll link it to the repo some time later.

Feel free to use it, but please don't consider yourself in any way obligated to.

I know your use case is slightly different from what I personally use the module for (inspiration source and on-the-fly generation of various tidbits while I GM, as well as rules "reference" to a much lesser extent), so if you have any insight into what works well/poorly for you, it would be much appreciated.

— Reply to this email directly, view it on GitHub https://github.com/vizovitin/foundryvtt-ask-chatgpt/issues/13#issuecomment-1789766216, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDRUX2TIPXTIPOP2I2ZQZFDYCLC7FAVCNFSM6AAAAAA6RZXUYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBZG43DMMRRGY . You are receiving this because you authored the thread.Message ID: @.***>

vizovitin commented 9 months ago

sometimes it's like the first time i'm chatting with (expecially after some day, don't know if it's because it auto-resets)

This is actually a current implementation limitation. It's mentioned in the corresponding option description:

Context is not shared among users and resets on page reload.

It's certainly possible to lift it, I just didn't consider this feature valuable enough, given that the system doesn't have long-term memory anyway.

And this ties in nicely to the next question.

if you have any tip

Python is a great language to learn! It's also very popular for machine learning, large language models (LLMs), and all that stuff. My advice is: have fun and create a small personal project to train on. It doesn't have to be something complex or new (i.e. it's fine if there's an alternative implementation, which might even be better), but it's best if it's something you are invested in and has a purpose. Regarding LLMs and GPT models: the funny thing is that these things are typically the simplest part of the applications that use them. Not in the way they work internally, but in the way they are used.

I've been trying to pay on ko-fi but every times I get an error message.

It seems the first attempt was declined due to failed 3D secure confirmation, and then the payment platform decided to block payments from you altogether. I guess they incorrectly considered this suspicious or something. I've asked their support to remove the block. They don't have ETA, but I'll notify you once I hear from them. Thanks for bearing with me, that stuff is new for me, so there are bound to be some bumps on the road.

vizovitin commented 8 months ago

So, long story short, Stripe support leaves a LOT to be desired, to put it mildly. They've managed to waste quite a lot of time.

So I've changed the payment provider. Though it took some time for verification in it as well. Hopefully everything should work correctly now.

Next week I'm gonna be a little bit more free, so I plan to do some updates to the module.