Skip to content

Conversation

@nasawz
Copy link

@nasawz nasawz commented Apr 25, 2025

The changes in this commit introduce the ZhipuProvider class, which implements the LLMProvider interface from the @voltagent/core package. This provider allows integration with the Zhipu AI API, enabling the use of Zhipu's language models within the Voltagent framework.

The key changes include:

  • Added ZhipuProvider class, implementing the LLMProvider interface with the following core functionalities:
    • generateText: Synchronous text generation.
    • streamText: Streaming text generation.
    • generateObject: Synchronous structured data generation.
    • streamObject: Streaming structured data generation (stub implementation).
  • Integrated Zhipu AI.
  • Supports API key configuration via the ZHIPU_API_KEY environment variable.
  • Default model configuration is glm-4-air, with tool integration support.

These changes allow the Voltagent framework to leverage the capabilities of the Zhipu AI language models, expanding the available options for developers using the Voltagent platform.

nasawz added 3 commits April 25, 2025 09:32
The changes in this commit introduce the `ZhipuProvider` class, which implements the `LLMProvider` interface from the `@voltagent/core` package. This provider allows integration with the Zhipu AI API, enabling the use of Zhipu's language models within the Voltagent framework.

The key changes include:

- Defining the `ZhipuProviderOptions` interface to handle the configuration options for the Zhipu AI provider.
- Implementing the `ZhipuProvider` class, which includes methods for generating text, streaming text, generating objects, and streaming objects using the Zhipu AI API.
- Providing utility functions like `toMessage` and `createStepFromChunk` to handle the conversion between Voltagent's message format and the Zhipu AI response format.
- Implementing the `getModelIdentifier` method to return the model identifier for the Zhipu AI language model.

These changes allow the Voltagent framework to leverage the capabilities of the Zhipu AI language models, expanding the available options for developers using the Voltagent platform.
feat(zhipu-ai): Implement ZhipuProvider for LLM integration
@omeraplak
Copy link
Member

Hey @nasawz ,
Thanks so much for the PR! 🙌 I’ll review it shortly and get back to you soon. ⚡

@omeraplak
Copy link
Member

Hey! If you’d like to add a changeset, that would be awesome but no pressure at all.
I can also add it for you if you prefer, just let me know!

Here’s a quick guide on how to create one:
https://voltagent.dev/docs/community/contributing/#creating-a-changeset

Thanks again for the contribution ⚡

@nasawz
Copy link
Author

nasawz commented Apr 25, 2025

Hey! No problem at all! Please go ahead and add the changeset this time. I’ll make sure to include one with my next submission. Thanks again for the guidance and for your help! ⚡

@omeraplak
Copy link
Member

Hey @nasawz ,
Thank you for your contribution ⚡

Would be awesome if you could also:
• Add it to the Providers Docs here:
https://github.com/VoltAgent/voltagent/blob/main/website/docs/agents/providers.md
(live version: https://voltagent.dev/docs/agents/providers/)
• And include a minimal example app like these:
https://github.com/VoltAgent/voltagent/tree/main/examples/with-vercel-ai
https://github.com/VoltAgent/voltagent/tree/main/examples/with-xsai

nasawz added 5 commits April 26, 2025 11:39
This commit adds a new example for integrating the Zhipu AI language model into a VoltAgent application. The key changes include:

1. Adding a new example directory `examples/with-zhipu-ai` with a detailed README file explaining the setup and usage.
2. Updating the `pnpm-lock.yaml` file to remove unnecessary `dev` flags and ensure consistent dependency versions.
3. Improving the error handling in the `ZhipuProvider` class to call the provided `onError` callback when an error occurs during the API response parsing.

These changes aim to provide a comprehensive example for developers to quickly get started with using the Zhipu AI language model within their VoltAgent-powered AI applications.
feat(voltagent): add example for Zhipu AI integration
@omeraplak
Copy link
Member

Hey @nasawz ,
We recently updated our provider docs (after you opened this PR).
Would you be able to pull from the main branch and update your changes based on the latest docs?

If you’re short on time, I can also handle it after merging. Totally up to you!
https://voltagent.dev/docs/providers/overview/

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2025

🦋 Changeset detected

Latest commit: 40e6b8d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@voltagent/zhipu-ai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

nasawz added 7 commits May 8, 2025 21:57
Bump @voltagent/cli from 0.1.2 to 0.1.5, core from 0.1.5 to 0.1.15,
and vercel-ai from 0.1.2 to 0.1.7 in with-zhipu-ai example to ensure
compatibility with recent fixes and improvements.
chore(deps): update @VoltAgent packages to latest versions
Bump @voltagent/core dependency from v0.1.3 to v0.1.14 to include
latest fixes and improvements. This ensures better compatibility
and stability for the zhipu-ai package.
chore(deps): update @voltagent/core to v0.1.14
@nasawz
Copy link
Author

nasawz commented May 9, 2025

Hey @omeraplak ,

I tried pulling from main and updating the changes, but I’m hitting issues with the auto-build. Could you take a look and help troubleshoot? I’d really appreciate your expertise here!

Thanks

@omeraplak
Copy link
Member

Hey @omeraplak ,

I tried pulling from main and updating the changes, but I’m hitting issues with the auto-build. Could you take a look and help troubleshoot? I’d really appreciate your expertise here!

Thanks

Hey,
Would you mind running pnpm install and pushing the changes?
Thanks a lot!

nasawz added 3 commits May 10, 2025 08:33
- Upgrade @types/node from 18.x to 20.x across multiple packages to support
  newer Node.js versions and improve type definitions.
- Update minimatch to 3.1.2 for better pattern matching and security fixes.
- Add new zhipu-ai package with dependencies on AI SDKs, type definitions,
  and tooling to support AI-related features.
- Introduce create-jest and jest-cli entries with updated peer dependencies
  and transitive peer dependencies for improved Jest integration.
- Ensure consistency in devDependencies and lockfile integrity for better
  package management and reproducibility.
chore: update dependencies and add zhipu-ai package
@nasawz
Copy link
Author

nasawz commented May 10, 2025

Hey @omeraplak
I’ve run pnpm install and pushed the changes. Let me know if everything looks good or if there’s anything else you need!

Thanks

@omeraplak omeraplak closed this Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants