diff --git a/.gitignore b/.gitignore index 7d2a7a64..929a5ba2 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,4 @@ internal/* *_phoneme.npy wandb depot/* +litellm_uuid.txt diff --git a/README.md b/README.md index 40a9b4ac..509eaf7f 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 diff --git a/run.py b/run.py index b44b7a7b..bc97cea2 100644 --- a/run.py +++ b/run.py @@ -1,5 +1,6 @@ import argparse import json +import os from dotenv import load_dotenv from langchain.chat_models import ChatLiteLLM @@ -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