From db41555bfca42a489c61c7090d36bcf7e7f919f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacques=20Verr=C3=A9?= Date: Thu, 21 Nov 2024 04:00:29 -0500 Subject: [PATCH] Fix broken links (#682) --- .../documentation/docs/cookbook/anthropic.md | 12 +++++++----- .../docs/tracing/integrations/langgraph.md | 8 ++++---- .../docs/tracing/log_multimodal_traces.md | 2 +- .../documentation/docs/tracing/log_traces.mdx | 18 +++++++----------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/apps/opik-documentation/documentation/docs/cookbook/anthropic.md b/apps/opik-documentation/documentation/docs/cookbook/anthropic.md index c47c4d0f3..181b42bae 100644 --- a/apps/opik-documentation/documentation/docs/cookbook/anthropic.md +++ b/apps/opik-documentation/documentation/docs/cookbook/anthropic.md @@ -56,9 +56,7 @@ PROMPT = "Why is it important to use a LLM Monitoring like CometML Opik tool tha response = anthropic_client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1024, - messages=[ - {"role": "user", "content": PROMPT} - ] + messages=[{"role": "user", "content": PROMPT}], ) print("Response", response.content[0].text) ``` @@ -87,7 +85,9 @@ anthropic_client = track_anthropic(anthropic) @track def generate_story(prompt): res = anthropic_client.messages.create( - model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": prompt}] + model="claude-3-5-sonnet-20241022", + max_tokens=1024, + messages=[{"role": "user", "content": prompt}], ) return res.content[0].text @@ -96,7 +96,9 @@ def generate_story(prompt): def generate_topic(): prompt = "Generate a topic for a story about Opik." res = anthropic_client.messages.create( - model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": prompt}] + model="claude-3-5-sonnet-20241022", + max_tokens=1024, + messages=[{"role": "user", "content": prompt}], ) return res.content[0].text diff --git a/apps/opik-documentation/documentation/docs/tracing/integrations/langgraph.md b/apps/opik-documentation/documentation/docs/tracing/integrations/langgraph.md index f6e5ba060..70127a9b0 100644 --- a/apps/opik-documentation/documentation/docs/tracing/integrations/langgraph.md +++ b/apps/opik-documentation/documentation/docs/tracing/integrations/langgraph.md @@ -15,7 +15,7 @@ Opik provides a seamless integration with LangGraph, allowing you to easily log ## Getting Started -To use the [`OpikTracer`](/python-sdk-reference/integrations/langchain/OpikTracer.html) with LangGraph, you'll need to have both the `opik` and `langgraph` packages installed. You can install them using pip: +To use the [`OpikTracer`](https://www.comet.com/docs/opik/python-sdk-reference/integrations/langchain/OpikTracer.html) with LangGraph, you'll need to have both the `opik` and `langgraph` packages installed. You can install them using pip: ```bash pip install opik langgraph @@ -29,7 +29,7 @@ opik configure ## Using the OpikTracer -You can use the [`OpikTracer`](/python-sdk-reference/integrations/langchain/OpikTracer.html) callback with any LangGraph graph by passing it in as an argument to the `stream` or `invoke` functions: +You can use the [`OpikTracer`](https://www.comet.com/docs/opik/python-sdk-reference/integrations/langchain/OpikTracer.html) callback with any LangGraph graph by passing it in as an argument to the `stream` or `invoke` functions: ```python from opik.integrations.langchain import OpikTracer @@ -55,7 +55,7 @@ Once the OpikTracer is configured, you will start to see the traces in the Opik ## Updating logged traces -You can use the [`OpikTracer.created_traces`](/python-sdk-reference/integrations/langchain/OpikTracer.html#opik.integrations.langchain.OpikTracer.created_traces) method to access the trace IDs collected by the OpikTracer callback: +You can use the [`OpikTracer.created_traces`](https://www.comet.com/docs/opik/python-sdk-reference/integrations/langchain/OpikTracer.html#opik.integrations.langchain.OpikTracer.created_traces) method to access the trace IDs collected by the OpikTracer callback: ```python from opik.integrations.langchain import OpikTracer @@ -68,7 +68,7 @@ traces = opik_tracer.created_traces() print([trace.id for trace in traces]) ``` -These can then be used with the [`Opik.log_traces_feedback_scores`](/python-sdk-reference/Opik.html#opik.Opik.log_traces_feedback_scores) method to update the logged traces. +These can then be used with the [`Opik.log_traces_feedback_scores`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.log_traces_feedback_scores) method to update the logged traces. ## Advanced usage diff --git a/apps/opik-documentation/documentation/docs/tracing/log_multimodal_traces.md b/apps/opik-documentation/documentation/docs/tracing/log_multimodal_traces.md index bacd0c967..f800d9a63 100644 --- a/apps/opik-documentation/documentation/docs/tracing/log_multimodal_traces.md +++ b/apps/opik-documentation/documentation/docs/tracing/log_multimodal_traces.md @@ -15,7 +15,7 @@ Opik supports multimodal traces allowing you to track not just the text input an Images logged to a trace in both base64 encoded images and as URLs are displayed in the trace sidebar. -We recommend that you use the [`track_openai`](/python-sdk-reference/integrations/openai/track_openai.html) wrapper to ensure the OpenAI API call is traced correctly: +We recommend that you use the [`track_openai`](https://www.comet.com/docs/opik/python-sdk-reference/integrations/openai/track_openai.html) wrapper to ensure the OpenAI API call is traced correctly: ```python from opik.integrations.openai import track_openai diff --git a/apps/opik-documentation/documentation/docs/tracing/log_traces.mdx b/apps/opik-documentation/documentation/docs/tracing/log_traces.mdx index 91774c72a..cb99961b7 100644 --- a/apps/opik-documentation/documentation/docs/tracing/log_traces.mdx +++ b/apps/opik-documentation/documentation/docs/tracing/log_traces.mdx @@ -14,7 +14,6 @@ import TabItem from "@theme/TabItem"; If you are just getting started with Opik, we recommend first checking out the [Quickstart](/quickstart.mdx) guide that will walk you through the process of logging your first LLM call. ::: - LLM applications are complex systems that do more than just call an LLM API, they will often involve retrieval, pre-processing and post-processing steps. Tracing is a tool that helps you understand the flow of your application and identify specific points in your application that may be causing issues. @@ -22,7 +21,6 @@ Opik's tracing functionality allows you to track not just all the LLM calls made ![Tracing in Opik](/img/tracing/introduction.png) - Opik provides different ways to log your LLM calls and traces to the platform: 1. **Using one of our [integrations](/tracing/integrations/overview.md):** This is the easiest way to get started. @@ -30,8 +28,6 @@ Opik provides different ways to log your LLM calls and traces to the platform: 3. **Using the Python SDK:** This allows for the most flexibility and customizability and is recommended if you want to have full control over the logging process. 4. **Using the Opik REST API:** If you are not using Python, you can use the REST API to log traces to the platform. The REST API is currently in beta and subject to change. - - ## Logging with the Python SDK In order to use the Opik Python SDK, you will need to install it and configure it: @@ -280,11 +276,11 @@ def llm_chain(input_text): ) ``` -You can learn more about the `opik_context` module in the [opik_context reference docs](/python-sdk-reference/opik_context/index.html). +You can learn more about the `opik_context` module in the [opik_context reference docs](https://www.comet.com/docs/opik/python-sdk-reference/opik_context/index.html). #### Disabling automatic logging -You can use the `capture_input` and `capture_output` parameters of the [`@track`](/python-sdk-reference/track.html) decorator to disable the automatic logging of the function input and output: +You can use the `capture_input` and `capture_output` parameters of the [`@track`](https://www.comet.com/docs/opik/python-sdk-reference/track.html) decorator to disable the automatic logging of the function input and output: ```python @track(capture_input=False, capture_output=False) @@ -297,12 +293,12 @@ You can then use the `opik_context` module to manually log the trace and span at ### Using the low-level Opik client -If you want full control over the data logged to Opik, you can use the [`Opik`](/python-sdk-reference/Opik.html) client to log traces, spans, feedback scores and more. +If you want full control over the data logged to Opik, you can use the [`Opik`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html) client to log traces, spans, feedback scores and more. #### Logging traces and spans -Logging traces and spans can be achieved by first creating a trace using [`Opik.trace`](/python-sdk-reference/Opik.html#opik.Opik.trace) -and then adding spans to the trace using the [`Trace.span`](/python-sdk-reference/Objects/Trace.html#opik.api_objects.trace.Trace.span) method: +Logging traces and spans can be achieved by first creating a trace using [`Opik.trace`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.trace) +and then adding spans to the trace using the [`Trace.span`](https://www.comet.com/docs/opik/python-sdk-reference/Objects/Trace.html#opik.api_objects.trace.Trace.span) method: ```python from opik import Opik @@ -341,8 +337,8 @@ It is recommended to call `trace.end()` and `span.end()` when you are finished w #### Logging feedback scores -You can log scores to traces and spans using the [`log_traces_feedback_scores`](/python-sdk-reference/Opik.html#opik.Opik.log_traces_feedback_scores) -and [`log_spans_feedback_scores`](/python-sdk-reference/Opik.html#opik.Opik.log_spans_feedback_scores) methods: +You can log scores to traces and spans using the [`log_traces_feedback_scores`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.log_traces_feedback_scores) +and [`log_spans_feedback_scores`](https://www.comet.com/docs/opik/python-sdk-reference/Opik.html#opik.Opik.log_spans_feedback_scores) methods: ```python from opik import Opik