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

fix(community): togetherai response different format handling #7488

Merged

Conversation

axe-me
Copy link
Contributor

@axe-me axe-me commented Jan 8, 2025

Apparently togetherAI now have more than one response format, other than the old one it also have a format like this:

{
    "id": "8fef9f62bf2dbef4-YYC",
    "object": "text.completion",
    "created": 1736375327,
    "model": "deepseek-ai/DeepSeek-V3",
    "choices": [
        {
            "index": 0,
            "text": " Paris",
            "logprobs": null,
            "finish_reason": "length",
            "matched_stop": null
        }
    ],
    "usage": {
        "prompt_tokens": 11,
        "total_tokens": 12,
        "completion_tokens": 1,
        "prompt_tokens_details": null
    },
    "prompt": []
}

This PR will update the code to handle format like that. Thanks for your time to review this!

Fixes # (issue) #6993
#6993

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 8, 2025
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jan 8, 2025 11:07pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Jan 8, 2025 11:07pm

@dosubot dosubot bot added the auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs label Jan 8, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 8, 2025
@jacoblee93
Copy link
Collaborator

Thank you!

Does this apply to chat models too?

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Jan 9, 2025
@jacoblee93 jacoblee93 merged commit a30c2fa into langchain-ai:main Jan 9, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs lgtm PRs that are ready to be merged as-is size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants