Metadata-Version: 2.1
Name: weave
Version: 0.50.2
Summary: A toolkit for building composable interactive data driven applications.
Author-email: Shawn Lewis <shawn@wandb.com>, Danny Goldstein <danny@wandb.com>, Tim Sweeney <tim@wandb.com>, Nick Peneranda <nick.penaranda@wandb.com>
Maintainer-email: W&B <support@wandb.com>
License: Apache-2.0
Project-URL: Company, https://wandb.com
Project-URL: Documentation, https://docs.wandb.com/
Project-URL: Changes, https://github.com/wandb/weave/releases
Project-URL: Source Code, https://github.com/wandb/weave
Project-URL: Issue Tracker, https://github.com/wandb/weave/issues/
Project-URL: Twitter, https://twitter.com/weights_biases
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Widget Sets
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing-extensions >=4.0.0
Requires-Dist: pyarrow >=14.0.1
Requires-Dist: openai >=1.0.0
Requires-Dist: tiktoken >=0.4.0
Requires-Dist: pydantic >=2.0.0
Requires-Dist: rich >=13.7.0
Requires-Dist: aiohttp >=3.8.3
Requires-Dist: aiofiles >=22.1.0
Requires-Dist: aioprocessing >=2.0.1
Requires-Dist: Werkzeug >=2.0.0
Requires-Dist: janus >=1.0.0
Requires-Dist: python-json-logger >=2.0.4
Requires-Dist: numpy >=1.21
Requires-Dist: wandb >=0.16.4
Requires-Dist: graphql-core >3
Requires-Dist: gql[requests] >=3.4.1
Requires-Dist: analytics-python >=1.2.9
Requires-Dist: packaging >=21.0
Provides-Extra: datadog
Requires-Dist: datadog ==0.44.0 ; extra == 'datadog'
Requires-Dist: ddtrace ==1.7.5 ; extra == 'datadog'
Provides-Extra: ecosystem
Requires-Dist: h5py >=3.8.0 ; extra == 'ecosystem'
Requires-Dist: openai >=1.0.0 ; extra == 'ecosystem'
Requires-Dist: matplotlib !=3.5,>3 ; extra == 'ecosystem'
Requires-Dist: shap >=0.41.0 ; extra == 'ecosystem'
Requires-Dist: xgboost >=1.7.3 ; extra == 'ecosystem'
Requires-Dist: torch >=1.13.1 ; extra == 'ecosystem'
Requires-Dist: torchvision >=0.14.1 ; extra == 'ecosystem'
Requires-Dist: bertviz >=1.4.0 ; extra == 'ecosystem'
Requires-Dist: datasets >=2.9.0 ; extra == 'ecosystem'
Requires-Dist: transformers <4.21 ; extra == 'ecosystem'
Requires-Dist: plotly >=5.13.0 ; extra == 'ecosystem'
Requires-Dist: sqlalchemy >=2.0.1 ; extra == 'ecosystem'
Requires-Dist: faiss-cpu >=1.7.4 ; extra == 'ecosystem'
Requires-Dist: replicate >=0.4.0 ; extra == 'ecosystem'
Requires-Dist: langchain >=0.0.132 ; extra == 'ecosystem'
Requires-Dist: tiktoken >=0.4.0 ; extra == 'ecosystem'
Requires-Dist: hdbscan >=0.8.27 ; extra == 'ecosystem'
Requires-Dist: pillow >=10.0.1 ; extra == 'ecosystem'
Requires-Dist: spacy <4.0.0,>=3.0.0 ; extra == 'ecosystem'
Provides-Extra: engine
Requires-Dist: sentry-sdk <1.29.0 ; extra == 'engine'
Requires-Dist: pandas >=1.5.3 ; extra == 'engine'
Requires-Dist: ipython >=7.34 ; extra == 'engine'
Requires-Dist: flask >=2.1 ; extra == 'engine'
Requires-Dist: black >=22.3.0 ; extra == 'engine'
Requires-Dist: flask-cors >=3.0.10 ; extra == 'engine'
Requires-Dist: notebook >=6.4.8 ; extra == 'engine'
Requires-Dist: ipynbname >=2021.3.2 ; extra == 'engine'
Requires-Dist: pillow >=10.0.1 ; extra == 'engine'
Requires-Dist: scikit-learn >=1.2.1 ; extra == 'engine'
Requires-Dist: umap-learn >=0.5.3 ; extra == 'engine'
Requires-Dist: typeguard >=4.1.3 ; extra == 'engine'
Requires-Dist: objgraph >=3.6.0 ; extra == 'engine'
Requires-Dist: tabulate ; extra == 'engine'
Requires-Dist: faiss-cpu ; extra == 'engine'
Requires-Dist: pytest-asyncio <=0.21.1 ; extra == 'engine'
Provides-Extra: examples
Requires-Dist: h5py >=3.8.0 ; extra == 'examples'
Requires-Dist: openai >=1.0.0 ; extra == 'examples'
Requires-Dist: matplotlib !=3.5,>3 ; extra == 'examples'
Requires-Dist: shap >=0.41.0 ; extra == 'examples'
Requires-Dist: xgboost >=1.7.3 ; extra == 'examples'
Requires-Dist: torch >=1.13.1 ; extra == 'examples'
Requires-Dist: torchvision >=0.14.1 ; extra == 'examples'
Requires-Dist: bertviz >=1.4.0 ; extra == 'examples'
Requires-Dist: datasets >=2.9.0 ; extra == 'examples'
Requires-Dist: transformers <4.21 ; extra == 'examples'
Requires-Dist: plotly >=5.13.0 ; extra == 'examples'
Requires-Dist: sqlalchemy >=2.0.1 ; extra == 'examples'
Requires-Dist: faiss-cpu >=1.7.4 ; extra == 'examples'
Requires-Dist: replicate >=0.4.0 ; extra == 'examples'
Requires-Dist: langchain >=0.0.132 ; extra == 'examples'
Requires-Dist: tiktoken >=0.4.0 ; extra == 'examples'
Requires-Dist: hdbscan >=0.8.27 ; extra == 'examples'
Requires-Dist: pillow >=10.0.1 ; extra == 'examples'
Requires-Dist: spacy <4.0.0,>=3.0.0 ; extra == 'examples'
Provides-Extra: modal
Requires-Dist: modal ; extra == 'modal'
Requires-Dist: python-dotenv ; extra == 'modal'

# **Weave by Weights & Biases**

Weave is a toolkit for developing Generative AI applications, built by [Weights & Biases](https://wandb.ai/).

---

You can use Weave to:

- Log and debug language model inputs, outputs, and traces
- Build rigorous, apples-to-apples evaluations for language model use cases
- Organize all the information generated across the LLM workflow, from experimentation to evaluations to production

Our goal is to bring rigor, best-practices, and composability to the inherently experimental process of developing Generative AI software, without introducing cognitive overhead.

<div align="center">
  <img src="./docs/static/weave-ui-example.jpg" width="400">
</div>

## Documentation

Our documentation site can be found [here](https://wandb.me/weave)

## Installation
```
pip install weave
```

## Usage

### Tracing
You can trace any function using `weave.op()` - from api calls to OpenAI, Anthropic, Google AI Studio etc to generation calls from Hugging Face and other open source models to any other validation functions or data transformations in your code you'd like to keep track of.

Decorate all the functions you want to trace, this will generate a trace tree of the inputs and outputs of all your functions:

```python
import weave
weave.init("weave-example")

@weave.op()
def sum_nine(value_one: int):
    return value_one + 9

@weave.op()
def multiply_two(value_two: int):
    return value_two * 2

@weave.op()
def main():
    output = sum_nine(3)
    final_output = multiply_two(output)
    return final_output

main()
```

### Fuller Example 

```python
import weave
import json
from openai import OpenAI

@weave.op()
def extract_fruit(sentence: str) -> dict:
    client = OpenAI()

    response = client.chat.completions.create(
    model="gpt-3.5-turbo-1106",
    messages=[
        {
            "role": "system",
            "content": "You will be provided with unstructured data, and your task is to parse it one JSON dictionary with fruit, color and flavor as keys."
        },
        {
            "role": "user",
            "content": sentence
        }
        ],
        temperature=0.7,
        response_format={ "type": "json_object" }
    )
    extracted = response.choices[0].message.content
    return json.loads(extracted)

weave.init('intro-example')

sentence = "There are many fruits that were found on the recently discovered planet Goocrux. There are neoskizzles that grow there, which are purple and taste like candy."

extract_fruit(sentence)
```


## Contributing

Interested in pulling back the hood or contributing? Awesome, before you dive in, here's what you need to know.

We're in the process of 🧹 cleaning up 🧹. This codebase contains a large amount code for the "Weave engine" and "Weave boards", which we've put on pause as we focus on Tracing and Evaluations.

The Weave Tracing code is mostly in: `weave/trace` and `weave/trace_server`.

The Weave Evaluations code is mostly in `weave/flow`.
