Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Bump magentic from 0.32.0 to 0.34.1#369

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/magentic-0.34.1
Closed

Bump magentic from 0.32.0 to 0.34.1#369
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/pip/magentic-0.34.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Dec 2, 2024

Copy link
Copy Markdown

Bumps magentic from 0.32.0 to 0.34.1.

Release notes

Sourced from magentic's releases.

v0.34.1

What's Changed

Full Changelog: jackmpcollins/magentic@v0.34.0...v0.34.1

v0.34.0

What's Changed

Add StreamedResponse and AsyncStreamedResponse to enable parsing responses that contain both text and tool calls. See PR jackmpcollins/magentic#383 or the new docs (copied below) https://magentic.dev/streaming/#StreamedResponse for more details.

⚡ StreamedResponse

Some LLMs have the ability to generate text output and make tool calls in the same response. This allows them to perform chain-of-thought reasoning or provide additional context to the user. In magentic, the StreamedResponse (or AsyncStreamedResponse) class can be used to request this type of output. This object is an iterable of StreamedStr (or AsyncStreamedStr) and FunctionCall instances.

!!! warning "Consuming StreamedStr"

The StreamedStr object must be iterated over before the next item in the `StreamedResponse` is processed, otherwise the string output will be lost. This is because the `StreamedResponse` and `StreamedStr` share the same underlying generator, so advancing the `StreamedResponse` iterator skips over the `StreamedStr` items. The `StreamedStr` object has internal caching so after iterating over it once the chunks will remain available.

In the example below, we request that the LLM generates a greeting and then calls a function to get the weather for two cities. The StreamedResponse object is then iterated over to print the output, and the StreamedStr and FunctionCall items are processed separately.

from magentic import prompt, FunctionCall, StreamedResponse, StreamedStr
def get_weather(city: str) -> str:
return f"The weather in {city} is 20°C."
@​prompt(
"Say hello, then get the weather for: {cities}",
functions=[get_weather],
)
def describe_weather(cities: list[str]) -> StreamedResponse: ...
response = describe_weather(["Cape Town", "San Francisco"])
for item in response:
if isinstance(item, StreamedStr):
for chunk in item:
# print the chunks as they are received
print(chunk, sep="", end="")
print()
if isinstance(item, FunctionCall):
# print the function call, then call it and print the result
print(item)
print(item())
</tr></table>

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label Dec 2, 2024
@dependabot dependabot Bot requested review from kxtran and wenzhe-log10 December 2, 2024 16:05
@dependabot dependabot Bot force-pushed the dependabot/pip/magentic-0.34.1 branch from b1f7190 to 658b69d Compare December 2, 2024 20:15
Bumps [magentic](https://github.com/jackmpcollins/magentic) from 0.32.0 to 0.34.1.
- [Release notes](https://github.com/jackmpcollins/magentic/releases)
- [Commits](jackmpcollins/magentic@v0.32.0...v0.34.1)

---
updated-dependencies:
- dependency-name: magentic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot force-pushed the dependabot/pip/magentic-0.34.1 branch from 658b69d to 24b32cd Compare December 5, 2024 17:40
@dependabot @github

dependabot Bot commented on behalf of github Jan 6, 2025

Copy link
Copy Markdown
Author

Superseded by #386.

@dependabot dependabot Bot closed this Jan 6, 2025
@dependabot dependabot Bot deleted the dependabot/pip/magentic-0.34.1 branch January 6, 2025 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants