Traces
All Ops
Filter
Past 1mo
inputs
Trace
Feedback
Status
k
max_tokens
query
use_rerank
output
User
Called
Tokens
Cost
5
800
How do I log a trace with Weave - for any arbitrary code?
N/A
To log a trace with Weave for arbitrary code, you need to follow these steps:
First, initialize Weave with `weave.init()` before you start logging [index]. Without initialization, your traces won't be captured.
For tracing specific functions, you can use the `@op` decorator, which "op-ifies" your function to enable tracing. This works for both synchronous and asynchronous code [index]:
```python
import weave
weave.init()
@weave.op
def my_function(x):
return x * 2
# This call will be tr...
2,279
$0.0000
5
800
How do I log a trace with Weave - for any arbitrary code?
N/A
Based on the provided context, to log a trace with Weave for arbitrary code (not just LangChain), you can use the `weave.attributes()` context manager to wrap your code blocks.
For arbitrary code tracing, the pattern shown in the context is:
```python
with weave.attributes({"my_awesome_attribute": "value"}):
# Your arbitrary code here
result = some_function()
print(result)
```
This approach [langchain] allows you to add custom attributes to your traces, which will then be tracked...
2,213
$0.0000
3
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, install Weave if you haven't already:
```bash
pip install weave
```
[openai:weave:README]
2. Import and initialize Weave with your project name:
```python
import weave
weave.init("my-project-name")
```
[hf:weave:README] [openai:weave:README] [cohere:weave:README]
3. Decorate any function you want to trace with the `@weave.op()` decorator:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
```
[...
2,614
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, install Weave if you haven't already:
```bash
pip install weave
```
2. Import and initialize Weave with your project name [hf:weave:README]:
```python
import weave
weave.init("my-project-name")
```
3. Decorate any function you want to trace with the `@weave.op()` decorator [openai:weave:README]:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
```
Weave allows you to trace any function in yo...
3,831
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, install Weave:
```bash
pip install weave
```
2. Import and initialize Weave with your project name [openai:weave:README]:
```python
import weave
weave.init("my-project-name")
```
3. Decorate any function you want to trace with the `@weave.op()` decorator [hf:weave:README]:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
```
This approach works for any function in your codebase - whether it'...
3,831
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
N/A
To log a trace with Weave for arbitrary code, follow these steps:
1. First, import Weave and initialize it with your project name:
```python
import weave
weave.init("my-project-name")
```
[hf:weave:README]
2. Decorate any function you want to trace with the `@weave.op()` decorator. This works for any function in your code - whether it's API calls, model generation functions, data transformations, or custom validation logic:
```python
@weave.op()
def my_function():
# Your tracked code!
...
1,802
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, install Weave:
```bash
pip install weave
```
2. Import and initialize Weave with your project name:
```python
import weave
weave.init("my-project-name")
```
3. Decorate any function you want to trace with `@weave.op()`:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
```
[openai:weave:README] This approach works for tracing "any function using `weave.op()` - from api calls to OpenAI, Anthro...
3,831
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, import the Weave library and initialize it with your project name:
```python
import weave
weave.init("my-project-name")
```
[hf:weave:README]
2. Then, decorate any function you want to trace with the `@weave.op()` decorator. This works for any function in your code - whether it's API calls, model generations, or custom data transformations:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
`...
1,802
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, import and initialize Weave with your project name:
```python
import weave
weave.init("my-project-name")
```
[hf:weave:README]
2. Then, decorate any function you want to trace with the `@weave.op()` decorator. This works for any function in your code - whether it's API calls, model generations, or custom data transformations:
```python
@weave.op()
def my_function():
# Your tracked code!
pass
```
[hf:weave:R...
1,802
$0.0000
5
800
How do I log a trace with Weave for arbitrary code
To log a trace with Weave for arbitrary code, follow these steps:
1. First, import the Weave library and initialize it with your project name:
```python
import weave
weave.init("my-project-name")
```
[hf:weave:README]
2. Then, decorate any function you want to trace with the `@weave.op()` decorator. This works for any function in your code - whether it's API calls, model generation functions, or custom data transformations:
```python
@weave.op()
def my_function():
# Your tracked code!
...
1,774
$0.0000
N/A
N/A
N/A
N/A
[{"name":"hf","model":"BAAI/bge-small-en-v1.5","retrieval_docs_per_index":10,"index_threshold":0.25,"max_num_docs_per_query":10},{"name":"openai","model":"text-embedding-3-large","retrieval_docs_per_index":10,"index_threshold":0.2,"max_num_docs_per_query":10}]
0
$0.0000
N/A
N/A
N/A
N/A
[{"name":"hf","model":"BAAI/bge-small-en-v1.5","retrieval_docs_per_index":10,"index_threshold":0.25,"max_num_docs_per_query":10},{"name":"openai","model":"text-embedding-3-large","retrieval_docs_per_index":10,"index_threshold":0.2,"max_num_docs_per_query":10}]
0
$0.0000
1-23 of 23
Per page:
50