Sergey Kozyrenko 2ab7977c19 fix(bedrock): refuse the turns the primary Anthropic door already refuses
Two conversations are rejected locally on the Anthropic door and were sent
anyway on both Bedrock doors: one ending in an assistant turn on a model that
does not take a prefill, and a forced tool choice combined with manual budget
thinking. Each cost a round trip to come back as a documented 400.

Both refusals now run once in the Bedrock entry point, ahead of the split
between InvokeModel and Converse, so the two transports answer alike. The
predicates are model-keyed, so a non-Claude id such as Amazon Nova passes
through untouched.

The two error types move to llms/reasoning, which both doors already import, and
the anthropic package keeps its names as aliases so existing callers and their
errors.As checks are unaffected. The prefill and forced-tool detectors move to
llms beside the types they inspect, replacing the anthropic-private copies.

Verified by mutation: removing the guard reddens all four rows.

PAGI-132

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 23:55:13 +07:00
2025-06-22 02:27:21 +03:00

⚠️ This is a fork of the original github.com/tmc/langchaingo repository.

🦜🔗 LangChain Go (fork)

go.dev reference scorecard Open in Dev Containers

Building applications with LLMs through composability, with Go!

🚀 Important Announcement 🚀

Starting from release v0.1.13-update.1, this fork is now a full-fledged library that does not require any replace directives in your go.mod file. You can simply add it to your project with:

go get github.com/vxcontrol/langchaingo@latest

Why this fork?

This fork was created to incorporate functionality from open Pull Requests that haven't been merged into the original repository yet. You can view the list of accepted PRs in our v0.1.13-update.0 release and in the main-pull-requests branch.

Additionally, this repository contains custom improvements and enhancements related to langchaingo support, which will be published as releases. The original repository's state can be accessed in the main branch, which will be regularly updated with upstream changes.

This fork is primarily maintained for use in the PentAGI project, an autonomous AI Agents system for performing complex penetration testing tasks.

Branch Structure and Versioning

This repository follows a specific branching strategy to maintain both upstream compatibility and custom enhancements:

Branch Management

  • main: Fully synchronized with upstream (tmc/langchaingo) using fast-forward merges.
  • main-pull-requests: Contains useful PRs from upstream that haven't been officially merged. Updated by merging from main after synchronization.
  • main-vxcontrol: Default branch containing all current enhancements including module name changes and stability improvements. Updated by merging from main-pull-requests.
  • release/v*: Created from main-vxcontrol for each release. These branches are stable to use in production, all tags are linked to these branches.

Versioning

Release tags follow the format v0.1.13-update.1, where:

  • v0.1.13 corresponds to the latest upstream release version
  • -update.1 indicates our increment number (starting at 1 and incrementing with each new release)

Each new release cumulatively includes all changes from previous releases on top of the current upstream state, ensuring that you always get the complete set of enhancements when using a specific tag.

Dependency Management

Important: When using this fork in your projects, always reference release tags for stable and predictable dependencies.

go get github.com/vxcontrol/langchaingo@v0.1.13-update.1

Branch Visualization

  main              A---B---C---D---E---F   (synced with upstream)
                         \       \
  main-pull-requests     G---H---I---J     (merged from main, PRs from upstream)
                              \       \
  main-vxcontrol              K---L---M   (default branch, merged from main-pull-requests)
                                   \
  release/vM.M.P-update.N          N     (tagged stable release)

For Contributors

If you want to contribute to this fork, please create Pull Requests based on the current state of the main-vxcontrol branch. Your contributions will be included in the next release when enough changes have accumulated.

When creating a PR, please ensure your changes are well-tested and include appropriate documentation. Once merged, your contributions will be included in the next stable release.

Acknowledgements

Special thanks to Travis Cline (@tmc) and all contributors who have made this project possible.

Original resources

🤔 What is this?

This is the Go language implementation of LangChain.

📖 Documentation

🎉 Examples

See ./examples for example usage.

package main

import (
  "context"
  "fmt"
  "log"

  "github.com/vxcontrol/langchaingo/llms"
  "github.com/vxcontrol/langchaingo/llms/openai"
)

func main() {
  ctx := context.Background()
  llm, err := openai.New()
  if err != nil {
    log.Fatal(err)
  }
  prompt := "What would be a good company name for a company that makes colorful socks?"
  completion, err := llms.GenerateFromSinglePrompt(ctx, llm, prompt)
  if err != nil {
    log.Fatal(err)
  }
  fmt.Println(completion)
}
$ go run .
Socktastic

Resources

Join the Discord server for support and discussions: Join Discord

Here are some links to blog posts and articles on using Langchain Go:

Contributors

There is a momentum for moving the development of langchaingo to a more community effort, if you are interested in being a maintainer or you are a contributor please join our Discord and let us know.

S
Description
LangChain for Go, the easiest way to write LLM-based programs in Go
Readme MIT 25 MiB
Latest
2026-03-15 11:58:21 -04:00
Languages
Go 99.8%
Makefile 0.2%