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

groq[minor]: Fix streaming metadata back to client #6573

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

bracesproul
Copy link
Member

@bracesproul bracesproul commented Aug 20, 2024

New concatenated AIMessage as a result of calling .stream looks like this:

AIMessageChunk {
  "id": "req_01j5pkw120f7wbwsxqs62742nj",
  "content": "The color of the sky can appear different depending on the time of day, weather, and location. On a clear day, the",
  "additional_kwargs": {},
  "response_metadata": {
    "finishReason": "length",
    "id": "chatcmpl-0f82c5dc-5701-4d67-9fe7-a403468466f0",
    "object": "chat.completion.chunk",
    "created": 1724114666,
    "model": "mixtral-8x7b-32768",
    "system_fingerprint": "fp_c5f20b5bb1",
    "x_groq": {
      "id": "req_01j5pkw120f7wbwsxqs62742nj",
      "usage": {
        "queue_time": 0.012457195,
        "prompt_tokens": 14,
        "prompt_time": 0.002072875,
        "completion_tokens": 26,
        "completion_time": 0.04022823,
        "total_tokens": 40,
        "total_time": 0.042301105
      }
    }
  },
  "tool_calls": [],
  "tool_call_chunks": [],
  "invalid_tool_calls": [],
  "usage_metadata": {
    "input_tokens": 14,
    "output_tokens": 26,
    "total_tokens": 40
  }
}

Copy link

vercel bot commented Aug 20, 2024

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

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 1:04am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Aug 20, 2024 1:04am

@bracesproul bracesproul marked this pull request as ready for review August 20, 2024 00:48
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs labels Aug 20, 2024
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 size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant