langchaingo

package module
v0.0.0-...-7b6d569 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 0 Imported by: 0

README

Fork之因

为什么要fork这个项目?

在使用项目过程中,有一些设计让我感觉用起来会有点难受,在上层也无法hack,即使可以hack,也会使代码非常丑陋

其次,有一些我认为必要的逻辑是存在缺失的,类似于agent里面无法使用vector、向量搜索无法显示score让我无法回测以确定score、agent无法设置LLM的参数等等,而这些问题作者也不鸟我!!!

最后,作者是国外的大神,但是对于国内的一些工具和模型更新较少,在监管下,总是会有些不便

所以,我fork了整个项目,并为此提供所需的能力支撑

同时,会定期merge源项目,保持能力一致

如果有pr和issue,欢迎来砸

🦜️🔗 LangChain Go

go.dev reference scorecard Open in Dev Containers

⚡ Building applications with LLMs through composability, with Go! ⚡

🤔 What is this?

This is the Go language implementation of LangChain.

📖 Documentation

🎉 Examples

See ./examples for example usage.

package main

import (
	"context"
	"log"

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

func main() {
	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 := llm.Call(context.Background(), prompt)
	if err != nil {
		log.Fatal(err)
	}
	log.Println(completion)
}
$ go run .

Socktastic!

Resources

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

Documentation

Overview

Package langchaingo implements the Go language version of the langchain project.

Directories

Path Synopsis
Package agent contains the standard interface all agents must implement, implementations of this interface, and an agent executor.
Package agent contains the standard interface all agents must implement, implementations of this interface, and an agent executor.
Package callbacks includes a standard interface for hooking into various stages of your LLM application.
Package callbacks includes a standard interface for hooking into various stages of your LLM application.
Package chains contains a standard interface for chains, a number of built in chains and functions for calling and running chains.
Package chains contains a standard interface for chains, a number of built in chains and functions for calling and running chains.
Package documentloaders includes a standard interface for loading documents from a source and implementations of this interface.
Package documentloaders includes a standard interface for loading documents from a source and implementations of this interface.
Package embeddings contains helpers for creating vector embeddings from text using different providers.
Package embeddings contains helpers for creating vector embeddings from text using different providers.
m3e
tei
Huggingface Text Embeddings Inference https://github.com/huggingface/text-embeddings-inference
Huggingface Text Embeddings Inference https://github.com/huggingface/text-embeddings-inference
examples
Package exp contains experimental code that is subject to change or removal.
Package exp contains experimental code that is subject to change or removal.
internal
util
Package util contins general helper functions.
Package util contins general helper functions.
Package jsonschema provides very simple functionality for representing a JSON schema as a (nested) struct.
Package jsonschema provides very simple functionality for representing a JSON schema as a (nested) struct.
Package llms provides unified support for interacting with different Language Models (LLMs) from various providers.
Package llms provides unified support for interacting with different Language Models (LLMs) from various providers.
ernie
Packaging ernie wrapper around the Baidu Large Language Model Platform APIs.
Packaging ernie wrapper around the Baidu Large Language Model Platform APIs.
local/internal/localclient
Package localclient provides a client for local LLMs.
Package localclient provides a client for local LLMs.
Package memory provides an interface for managing conversational data and a variety of implementations for storing and retrieving that data.
Package memory provides an interface for managing conversational data and a variety of implementations for storing and retrieving that data.
Package outputparser provides a set of output parsers to process structured or unstructured data from language models (LLMs).
Package outputparser provides a set of output parsers to process structured or unstructured data from language models (LLMs).
Package prompts contains types, prompt templates, loading utilities, output parsers, example selectors, and other utilities for working with LLM prompts..
Package prompts contains types, prompt templates, loading utilities, output parsers, example selectors, and other utilities for working with LLM prompts..
Package schema implements a shared core set of data types for use in langchaingo.
Package schema implements a shared core set of data types for use in langchaingo.
Package textsplitter provides tools for splitting long texts into smaller chunks based on configurable rules and parameters.
Package textsplitter provides tools for splitting long texts into smaller chunks based on configurable rules and parameters.
Package tools defines a standard interface for tools to be used by agents.
Package tools defines a standard interface for tools to be used by agents.
duckduckgo
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.
metaphor
// Package metaphor contains an implementation of the tool interface with the metaphor search api client.
// Package metaphor contains an implementation of the tool interface with the metaphor search api client.
scraper
Package scraper contains an implementation of the tool interface for a web scraping tool.
Package scraper contains an implementation of the tool interface for a web scraping tool.
serpapi
Package serpapi contains an implementation of the tool interface with the serapi.
Package serpapi contains an implementation of the tool interface with the serapi.
wikipedia
Package wikipedia contains an implementation of the tool interface with the wikipedia api.
Package wikipedia contains an implementation of the tool interface with the wikipedia api.
zapier
Package zapier contains an implementation of the tool interface with the zapier NLA api client.
Package zapier contains an implementation of the tool interface with the zapier NLA api client.
Package vectorstores contains the implementation of VectorStore, an interface for saving and querying documents as vector embeddings.
Package vectorstores contains the implementation of VectorStore, an interface for saving and querying documents as vector embeddings.
chroma
Package chroma contains an implementation of the vectorStore interface that connects to an external Chroma database.
Package chroma contains an implementation of the vectorStore interface that connects to an external Chroma database.
pinecone
Package pinecone contains an implementation of the vectorStore interface using pinecone.
Package pinecone contains an implementation of the vectorStore interface using pinecone.
weaviate
Package weaviate contains an implementation of the vectorStore interface using weaviate.
Package weaviate contains an implementation of the vectorStore interface using weaviate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL