Skip to content

Commit

Permalink
!!! move files from weave/legacy -> weave/legacy/weave to match new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 28, 2024
1 parent 879dcdf commit 81c246f
Show file tree
Hide file tree
Showing 615 changed files with 15,095 additions and 15,010 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,42 @@ jobs:
DD_SERVICE: weave-python
DD_ENV: ci
WEAVE_SENTRY_ENV: ci
CI: 1
WB_SERVER_HOST: http://wandbservice
WF_CLICKHOUSE_HOST: weave_clickhouse
WEAVE_SERVER_DISABLE_ECOSYSTEM: 1
# This runner specifically runs the tests that use the `client` fixture (those that support clickhouse client tests)
# However, we skip tests marked with `skip_clickhouse_client`. These should be considered TODOs and an exception
run: CI=1 WB_SERVER_HOST=http://wandbservice WF_CLICKHOUSE_HOST=weave_clickhouse WEAVE_SERVER_DISABLE_ECOSYSTEM=1 source /root/venv/bin/activate && cd weave && pytest -m "weave_client and not skip_clickhouse_client" --weave-server=clickhouse --job-num=${{ matrix.job_num }} --timeout=90 ./flow ./integrations ./legacy/tests ./tests ./legacy/ops_arrow ./legacy/ecosystem ./trace_server ./trace --ddtrace --durations=5
run: |
source /root/venv/bin/activate && \
cd weave && \
pytest -m "weave_client and not skip_clickhouse_client" \
--weave-server=clickhouse \
--job-num=${{ matrix.job_num }} \
--timeout=90 \
--ddtrace \
--durations=5 \
./integrations ./legacy ./trace_server ./trace ./tests
- name: Run Python Unit Tests
env:
DD_SERVICE: weave-python
DD_ENV: ci
WEAVE_SENTRY_ENV: ci
run: CI=1 WB_SERVER_HOST=http://wandbservice WF_CLICKHOUSE_HOST=weave_clickhouse WEAVE_SERVER_DISABLE_ECOSYSTEM=1 source /root/venv/bin/activate && pip install 'dspy-ai>=0.1.5' && pip install pydantic -U && cd weave && pytest --job-num=${{ matrix.job_num }} --timeout=90 ./flow ./integrations ./legacy/tests ./tests ./legacy/ops_arrow ./legacy/ecosystem ./trace_server ./trace --ddtrace --durations=5
CI: 1
WB_SERVER_HOST: http://wandbservice
WF_CLICKHOUSE_HOST: weave_clickhouse
WEAVE_SERVER_DISABLE_ECOSYSTEM: 1
run: |
source /root/venv/bin/activate && \
pip install 'dspy-ai>=0.1.5' && \
pip install pydantic -U && \
cd weave && \
pytest \
--job-num=${{ matrix.job_num }} \
--timeout=90 \
--ddtrace \
--durations=5 \
./integrations ./legacy ./trace_server ./trace ./tests
# nbmake:
# name: Run notebooks with nbmake
Expand Down
2 changes: 1 addition & 1 deletion examples/prompts/llm_monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ There are two main ways to authenticate OpenAI API calls so you can view them in
### OpenAI API

1. Set your OPENAI_API_KEY in your environment/script/notebook (e.g. via `os.environ["OPENAI_API_KEY"]`).
2. Import openai as follows: `from weave.legacy.monitoring import openai`.
2. Import openai as follows: `from weave.legacy.weave.monitoring import openai`.
3. Make calls via the OpenAI SDK as usual.

See details and create an interactive board in the [OpenAI monitoring notebook](./openai_client_quickstart.ipynb).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"metadata": {},
"outputs": [],
"source": [
"from weave.legacy.monitoring import openai, init_monitor\n",
"from weave.legacy.weave.monitoring import openai, init_monitor\n",
"m = init_monitor(f\"{WB_ENTITY}/{WB_PROJECT}/{STREAM_NAME}\")\n",
"\n",
"# specifying a single model for simplicity\n",
Expand Down Expand Up @@ -245,7 +245,7 @@
"metadata": {},
"outputs": [],
"source": [
"from weave.legacy.monitoring.openai import message_from_stream\n",
"from weave.legacy.weave.monitoring.openai import message_from_stream\n",
"r = openai.ChatCompletion.create(model=OPENAI_MODEL, messages=[\n",
" {\"role\": \"system\", \"content\": \"You are a robot and only speak in robot, like beep bloop bop.\"},\n",
" {\"role\": \"user\", \"content\": \"Tell me a 50-word story.\"},\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@
"outputs": [],
"source": [
"import openai\n",
"from weave.legacy.monitoring import openai as openaimon\n",
"from weave.legacy.monitoring import init_monitor\n",
"from weave.legacy.weave.monitoring import openai as openaimon\n",
"from weave.legacy.weave.monitoring import init_monitor\n",
"\n",
"m = init_monitor(f\"{WB_ENTITY}/{WB_PROJECT}/{STREAM_NAME}\")\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave.legacy.monitoring import StreamTable\n",
"from weave.legacy.weave.monitoring import StreamTable\n",
"from weave.stream_data_interfaces import TraceSpanDict"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"source": [
"import weave\n",
"import time\n",
"from weave.legacy.monitoring import init_monitor"
"from weave.legacy.weave.monitoring import init_monitor"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"source": [
"import langchain\n",
"import weave\n",
"from weave.legacy.monitoring.langchain import WeaveTracer"
"from weave.legacy.weave.monitoring.langchain import WeaveTracer"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions integration_test/cypress/e2e/interactive/blank.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import weave
from weave.legacy.show import show_url
from weave.legacy.weave.show import show_url

weave.use_fixed_server_port()
obj = [
1,
2,
3,
] # weave.legacy.panels.Board({}, [weave.legacy.panels.BoardPanel(weave.legacy.panels.Table([1, 2, 3]))])
] # weave.legacy.weave.panels.Board({}, [weave.legacy.weave.panels.BoardPanel(weave.legacy.weave.panels.Table([1, 2, 3]))])
blank = weave.save(obj)

print(show_url(obj))
9 changes: 5 additions & 4 deletions integration_test/cypress/e2e/interactive/distribution.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import random

import weave
from weave.legacy import panels
from weave.legacy.show import show_url
from weave.legacy.weave import panels
from weave.legacy.weave.show import show_url

# Weave package now defaults to eager mode, but lazy mode required for this example notebook for now.
weave.use_lazy_execution()
from weave.legacy.ecosystem import wandb
from weave.legacy.weave.ecosystem import wandb

weave.use_fixed_server_port()

Expand Down Expand Up @@ -38,7 +38,8 @@
{},
[
panels.BoardPanel(
panel, layout=weave.legacy.panels.BoardPanelLayout(x=0, y=0, w=24, h=12)
panel,
layout=weave.legacy.weave.panels.BoardPanelLayout(x=0, y=0, w=24, h=12),
)
],
)
Expand Down
10 changes: 5 additions & 5 deletions integration_test/cypress/e2e/interactive/scatter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import random

import weave
from weave.legacy.ecosystem import wandb
from weave.legacy.show import show_url
from weave.legacy.weave.ecosystem import wandb
from weave.legacy.weave.show import show_url

weave.use_fixed_server_port()

Expand All @@ -19,14 +19,14 @@
]
)

panel: weave.legacy.panels.Group = weave.legacy.panels.Group(
panel: weave.legacy.weave.panels.Group = weave.legacy.weave.panels.Group(
items={
"scatter": wandb.Scatter( # type: ignore
data, x_fn=lambda item: item["a"], y_fn=lambda item: item["b"]
),
"table": lambda scatter: weave.legacy.panels.LabeledItem(
"table": lambda scatter: weave.legacy.weave.panels.LabeledItem(
label="Selected items",
item=weave.legacy.panels.Group(
item=weave.legacy.weave.panels.Group(
style="height: 400px;",
preferHorizontal=True,
items={"table": scatter.selected()},
Expand Down
Loading

0 comments on commit 81c246f

Please sign in to comment.