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

Langsmith implementation #83

Merged
merged 4 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@ internal/*
*_phoneme.npy
wandb
depot/*
litellm_uuid.txt
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ The AI Sales Agent understands the conversation stage (you can define your own s
### Human in the loop
- For use cases where AI sales agent needs human supervision.

### Langsmith tracing
- debug, test, evaluate, and monitor chains and intelligent agents built on any LLM framework

### Enterprise-Grade Security

- Upcoming integration with [PromptArmor](https://promptarmor.com/) to protect your AI Sales Agents against security vulnerabilities (see our roadmap).
Expand Down Expand Up @@ -247,6 +250,24 @@ Please refer to [README-api.md](https://github.com/filip-michalsky/SalesGPT/blob

We leverage the [`langchain`](https://github.com/hwchase17/langchain) library in this implementation, specifically [Custom Agent Configuration](https://langchain-langchain.vercel.app/docs/modules/agents/how_to/custom_agent_with_tool_retrieval) and are inspired by [BabyAGI](https://github.com/yoheinakajima/babyagi) architecture.

## LangSmith tracing

LangSmith is a platform for building production-grade LLM applications.

It lets you debug, test, evaluate, and monitor chains and intelligent agents built on any LLM framework and seamlessly integrates with LangChain, the go-to open source framework for building with LLMs.

LangSmith is developed by LangChain, the company behind the open source LangChain framework.

To switch on the LangSmith tracing you have to do the following steps:

1. [Create a LangSmith account](https://smith.langchain.com/)
2. [Create an API key in settings](https://smith.langchain.com/settings)
3. Add you API key and Project name from LangSmith account to .env file or run.py module
4. Switch on the "LANGCHAIN_TRACING_V2" setting in run.py to "true"
5. That's it. You'll get better understanding of your agents and chaing performance in LangChain admin panel.

For futher reading take a look at the [docs](https://docs.smith.langchain.com/)

# Roadmap

1) Documenting the Repo better
Expand Down
7 changes: 7 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import json
import os

from dotenv import load_dotenv
from langchain.chat_models import ChatLiteLLM
Expand All @@ -8,6 +9,12 @@

load_dotenv() # loads .env file

# LangSmith settings section, set TRACING_V2 to "true" to enable it
# or leave it as it is, if you don't need tracing (more info in README)
os.environ["LANGCHAIN_TRACING_V2"] = "false"
os.environ["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"
os.environ["LANGCHAIN_API_KEY"] = os.getenv("LANGCHAIN_SMITH_API_KEY")
os.environ["LANGCHAIN_PROJECT"] = "" # insert you project name here

if __name__ == "__main__":
# Initialize argparse
Expand Down