Skip to content

Commit

Permalink
update apps
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdias committed Sep 19, 2024
1 parent 93665bb commit 79b3158
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/quick-start-llm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ stop: ## stop all running containers
@docker compose down

test: ## run e2e tests
@npx playwright test
@tracetest run -f ./tests/run-gemini.yaml
27 changes: 20 additions & 7 deletions examples/quick-start-llm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

This is an example of a simple LLM app that uses the `langchain` library to summarize the content of a URL, based on [this example](https://github.com/alphasecio/langchain-examples/tree/main/url-summary)

### Starting new env from scratch
### Running example with docker

```bash
make start/on-docker
```

### Running example with locally

#### Setting up the environment

```bash

Expand All @@ -20,14 +28,19 @@ opentelemetry-bootstrap -a install

# add openai api key
echo "OPENAI_API_KEY={your-open-ai-api-key}" >> .env
# add google gemini api key
echo "GOOGLE_API_KEY={your-google-gemini-api-key}" >> .env

# add tracetest agent keys
echo "TRACETEST_API_KEY={your-tracetest-api-key}" >> .env
echo "TRACETEST_ENVIRONMENT_ID={your-tracetest-env-id}" >> .env
```

### Run example
#### Running the apps

```bash
OTEL_SERVICE_NAME=quick-start-llm \
OTEL_TRACES_EXPORTER=console,otlp \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=localhost:4317 \
opentelemetry-instrument \
streamlit run ./app/streamlit_app.py

make start/local-ui
make start/local-api

```
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def summarize(self, text):
raise ValueError("Please provide the OpenAI API Key on a .env file.")

llm = ChatOpenAI(
model="gpt-3.5-turbo-instruct",
model="gpt-4o-mini",
openai_api_key=openai_api_key
)

Expand Down

0 comments on commit 79b3158

Please sign in to comment.