Skip to content
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

Bug: message was cut off in the middle of conversation #1030

Closed
1 of 4 tasks
devanenWl opened this issue Dec 9, 2024 · 0 comments
Closed
1 of 4 tasks

Bug: message was cut off in the middle of conversation #1030

devanenWl opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@devanenWl
Copy link
Contributor

devanenWl commented Dec 9, 2024

Issue Description

When I ask something which requires to generate long message, it will be cut off although it hasn't finished yet. I think it because of the hard-coded 1000 max_tokens

const completion = await this.anthropic.messages.stream({
    model: model ?? this.get_default_model(),
    max_tokens: 1000,
    temperature: 0,
    system: PUTER_PROMPT + JSON.stringify(system_prompts),
    messages: adapted_messages,
});

Steps to reproduce

<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
    (async () => {
        const resp = await puter.ai.chat([{"role":"user","content":"Can you help me to create a chess game in React ?"}], {model: 'claude-3-5-sonnet', stream: true });
        for await ( const part of resp ) puter.print(part?.text?.replaceAll('\n', '<br>'));
    })();
    </script>
</body>
</html>

Expected behaviour

No response

Addition Information or Screenshots (if applicable)

No response

Deployment

  • Production (puter.com)
  • Development (npm run start)
  • Docker (via docker run)
  • Docker (via docker-compose)

Puter version

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant