- Raised the `go` directive from 1.24.1 to 1.26.5 to satisfy pgx/v5 and ollama's minimum Go version requirements and to pick up 15 patched standard library CVEs. - Updated `pgx/v5`, `otel`/`otel/sdk`/`otlptracehttp`, `x/net`, and the AWS `eventstream` protocol package to their latest requested versions. - Remediated govulncheck-flagged CVEs in `grpc`, `x/text`, `x/crypto`, `antchfx/xpath`, AWS SDK `bedrock*`/`s3` services, `etcd/server`, and `mongo-driver` v1/v2. - Fixed ollama's `MainGPU` API type change (`int` -> `*int`) in `llms/ollama/options.go` without breaking the public `WithRunnerMainGPU` signature.
Anthropic Completion Example
Hello there, fellow Go enthusiasts and AI adventurers! 👋 Welcome to this exciting example of using the Anthropic API with Go!
What's in this directory?
This directory contains a simple yet powerful example of how to use the Anthropic API to generate text completions using Go. Here's what you'll find:
anthropic_completion_example.go: This is the main Go file that demonstrates how to use the Anthropic API. It's a great starting point for your AI-powered adventures!
What does the code do?
The anthropic_completion_example.go file showcases how to:
- Initialize an Anthropic LLM (Language Model) client
- Generate text completions using the Claude 3 Opus model
- Stream the generated text in real-time
It even includes a fun prompt asking Claude to write a poem about Golang-powered AI systems! 🤖📝
How to use this example
- Make sure you have Go installed on your system.
- Set up your Anthropic API key as an environment variable.
- Run the example using
go run anthropic_completion_example.go. - Watch as the AI-generated poem streams to your console!
Dependencies
This project uses the fantastic langchaingo library to interact with the Anthropic API. It's a great tool for building AI-powered applications in Go!
What to expect
When you run the example, you'll see a poem about Golang-powered AI systems being generated and printed to your console in real-time. It's like watching an AI poet at work! 🎭
Have fun!
We hope this example inspires you to create amazing AI-powered applications using Go and Anthropic's powerful language models. Happy coding! 🚀🎉