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

Add langtrace for sending traces to Elastic APM #357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion example-apps/chatbot-rag-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ tar -xz --strip=2 elasticsearch-labs-main/example-apps/chatbot-rag-app

There are a number of ways to install Elasticsearch. Cloud is best for most use-cases. Visit the [Install Elasticsearch](https://www.elastic.co/search-labs/tutorials/install-elasticsearch) for more information.

Note: This example needs a ELSER model so make sure a ML node with at least 8GB RAM on the cluster is deployed and then deploy the ELSER model on the node.

### Connect to Elasticsearch

This app requires the following environment variables to be set to connect to Elasticsearch hosted on Elastic Cloud:
Expand Down Expand Up @@ -176,7 +178,7 @@ With the environment variables set, you can run the following commands to start

#### Pre-requisites

- Python 3.8+
- Python 3.8+ and <3.12 (tiktoken will not install for python >= 3.12)
- Node 14+

#### Install the dependencies
Expand Down
3 changes: 3 additions & 0 deletions example-apps/chatbot-rag-app/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from chat import ask_question
import os
import sys
from langtrace_python_sdk import langtrace

langtrace.init()

app = Flask(__name__, static_folder="../frontend/build", static_url_path="/")
CORS(app)
Expand Down
3 changes: 2 additions & 1 deletion example-apps/chatbot-rag-app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ yarl==1.11.1
# via aiohttp
zipp==3.20.2
# via importlib-metadata

langchain-elasticsearch==0.3.0
langtrace-python-sdk>=3.3.14
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools