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

.Net: Anthropic - streaming #8560

Conversation

Krzysztof318
Copy link
Contributor

Motivation and Context

#5690

Description

Added streaming functionality and related tests.

@RogerBarreto @RogerBarret0

Contribution Checklist

@Krzysztof318 Krzysztof318 requested a review from a team as a code owner September 5, 2024 21:54
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Sep 5, 2024
@github-actions github-actions bot changed the title Anthropic - streaming .Net: Anthropic - streaming Sep 5, 2024
@RogerBarreto RogerBarreto self-assigned this Sep 6, 2024
@RogerBarreto
Copy link
Member

Please fix the UnitTests.

@therealpaulgg
Copy link

not sure what else is going on with this PR but I have the following notes:

I wasn't able to get Vertex AI anthropic to work without the following changes:

  • [JsonPropertyName("anthropic_version")] on the 'Version' attribute in AnthropicRequest
    • Reason: anthropic_version is required in the body for Vertex AI
  • adding JsonIgnore to the 'Model' attribute in [JsonPropertyName("anthropic_version")]
    • Reason: Vertex AI doesn't allow extra attributes in the request, and the endpoint already contains the model as documented here

I would suggest making these simple changes but these will likely impact Anthropic and Bedrock implementations of this. Perhaps some additional work needs to be done to make things more compatible (maybe let's pass the type of service and not try to determine it implicitly?)

As for the failing unit tests I'm not sure what's going on there.

Removed readonly modifiers from private fields _contentBlock and _delta to ensure proper JSON deserialization. This change allows modification of these fields during runtime, facilitating smoother data handling.
@Krzysztof318
Copy link
Contributor Author

@RogerBarreto fixed

@RogerBarreto RogerBarreto merged commit 17cfd02 into microsoft:feature-connectors-anthropic Oct 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants