Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Last active December 31, 2024 23:39
Show Gist options
  • Save elijahbenizzy/068ac74ae42220015298fa0e1e29001d to your computer and use it in GitHub Desktop.
Save elijahbenizzy/068ac74ae42220015298fa0e1e29001d to your computer and use it in GitHub Desktop.
# Instrumenting OpenTelemetry for LanceDB and OpenAI
OpenAIInstrumentor().instrument()
LanceInstrumentor().instrument()
# Define the application graph
app = (
ApplicationBuilder()
.with_actions(
fetch_webpage=fetch_webpage,
embed_and_store=embed_and_store,
ask_question=ask_question)
.with_transitions(
("fetch_webpage", "embed_and_store"),
("embed_and_store", "ask_question")
)
.with_entrypoint("fetch_webpage")
.with_tracker(project="chat-webpage-simple-rag", use_otel_tracing=True)
.build()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment