Skip to content

Commit

Permalink
Merge branch 'main' into kiko/structured-logging
Browse files Browse the repository at this point in the history
* main:
  chore(main): release arize-phoenix 4.35.1 (#4644)
  fix: submodule packaging for bazel (#4643)
  chore(main): release arize-phoenix 4.35.0 (#4638)
  Update file name to dodge gcs caching (#4639)
  feat: adds o1 testing demo project (#4636)
  chore(main): release arize-phoenix 4.34.0 (#4624)
  feat: finer grain last N time range (#4632)
  chore(main): release arize-phoenix-evals 0.16.0 (#4574)
  chore(main): release arize-phoenix-otel 0.5.1 (#4629)
  feat: OpenAI support for o1 preview (#4633)
  ci: cron for python integration test (#4611)
  • Loading branch information
fjcasti1 committed Sep 17, 2024
2 parents 1e10a8d + 68c9b74 commit a357d1c
Show file tree
Hide file tree
Showing 19 changed files with 198 additions and 71 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Python Cron

on:
schedule:
- cron: "*/15 15-23 * * *"
workflow_dispatch:

jobs:
integration-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: phoenix
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
ref: auth
- uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install tox-uv==1.11.3
- run: tox run-parallel --parallel-no-spinner -e py38-test-integration_tests
- uses: slackapi/slack-github-action@v1
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
payload: |
{
"text": "FAILED Python Integration Test: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"4.33.2","packages/phoenix-evals":"0.15.1","packages/phoenix-otel":"0.5.0"}
{".":"4.35.1","packages/phoenix-evals":"0.16.0","packages/phoenix-otel":"0.5.1"}
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## [4.35.1](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v4.35.0...arize-phoenix-v4.35.1) (2024-09-17)


### Bug Fixes

* submodule packaging for bazel ([#4643](https://github.com/Arize-ai/phoenix/issues/4643)) ([f780d34](https://github.com/Arize-ai/phoenix/commit/f780d3475e50c523f45ab4df5ca32321c748740c))

## [4.35.0](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v4.34.0...arize-phoenix-v4.35.0) (2024-09-17)


### Features

* adds o1 testing demo project ([#4636](https://github.com/Arize-ai/phoenix/issues/4636)) ([8140eaf](https://github.com/Arize-ai/phoenix/commit/8140eafba457b443aa4684bd2ecf978ed0dc85df))

## [4.34.0](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v4.33.2...arize-phoenix-v4.34.0) (2024-09-17)


### Features

* finer grain last N time range ([#4632](https://github.com/Arize-ai/phoenix/issues/4632)) ([021f4e8](https://github.com/Arize-ai/phoenix/commit/021f4e84442b0b4b298906a0d441472cba98f55e))


### Documentation

* create groq_tracing_tutorial.ipynb ([#4615](https://github.com/Arize-ai/phoenix/issues/4615)) ([5883c5a](https://github.com/Arize-ai/phoenix/commit/5883c5af296bc77f5249ec955b397ef041041507))
* **quickstart:** convert Phoenix inferences instructions to notebook ([#4593](https://github.com/Arize-ai/phoenix/issues/4593)) ([1e9541a](https://github.com/Arize-ai/phoenix/commit/1e9541a142bd040be726f78d530ceef796c2593c))

## [4.33.2](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-v4.33.1...arize-phoenix-v4.33.2) (2024-09-12)


Expand Down
33 changes: 14 additions & 19 deletions app/src/components/datetime/LastNTimeRangeContext.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, {
createContext,
startTransition,
useCallback,
useState,
} from "react";
import React, { createContext } from "react";

import { usePreferencesContext } from "@phoenix/contexts/PreferencesContext";

import { LastNTimeRangeKey } from "./types";
import { getTimeRangeFromLastNTimeRangeKey } from "./utils";
Expand Down Expand Up @@ -36,23 +33,21 @@ export function useLastNTimeRange(): LastNTimeRangeContextType {
}

export function LastNTimeRangeProvider({
initialTimeRangeKey = "7d",
children,
}: {
initialTimeRangeKey?: LastNTimeRangeKey;
children: React.ReactNode;
}) {
const [timeRangeKey, _setTimeRangeKey] =
useState<LastNTimeRangeKey>(initialTimeRangeKey);
const [timeRange, _setTimeRange] = useState<TimeRange>(() => {
return getTimeRangeFromLastNTimeRangeKey(initialTimeRangeKey);
});
const setTimeRangeKey = useCallback((key: LastNTimeRangeKey) => {
startTransition(() => {
_setTimeRangeKey(key);
_setTimeRange(getTimeRangeFromLastNTimeRangeKey(key));
});
}, []);
const timeRangeKey = usePreferencesContext(
(state) => state.lastNTimeRangeKey
);
const setTimeRangeKey = usePreferencesContext(
(state) => state.setLastNTimeRangeKey
);

// TODO: this caching doesn't move the time forward and is flawed
// Needs refactoring
const timeRange = getTimeRangeFromLastNTimeRangeKey(timeRangeKey);

return (
<LastNTimeRangeContext.Provider
value={{
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/datetime/LastNTimeRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function LastNTimeRangePicker(props: LastNTimeRangePickerProps) {
aria-label={"Time Range"}
addonBefore={<Icon svg={<Icons.CalendarOutline />} />}
isDisabled={isDisabled}
defaultSelectedKey={selectedKey}
selectedKey={selectedKey}
onSelectionChange={(key: Key) => {
onSelectionChange && onSelectionChange(key as LastNTimeRangeKey);
}}
Expand Down
3 changes: 3 additions & 0 deletions app/src/components/datetime/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { LastNTimeRange, LastNTimeRangeKey } from "./types";

export const LAST_N_TIME_RANGES: LastNTimeRange[] = [
{ key: "15m", label: "Last 15 Min" },
{ key: "1h", label: "Last Hour" },
{ key: "12h", label: "Last 12 Hours" },
{ key: "1d", label: "Last Day" },
{ key: "7d", label: "Last 7 Days" },
{ key: "30d", label: "Last Month" },
Expand Down
9 changes: 8 additions & 1 deletion app/src/components/datetime/types.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
export type LastNTimeRangeKey = "1d" | "7d" | "30d" | "all";
export type LastNTimeRangeKey =
| "15m"
| "1h"
| "12h"
| "1d"
| "7d"
| "30d"
| "all";
export type LastNTimeRange = { key: LastNTimeRangeKey; label: string };
24 changes: 23 additions & 1 deletion app/src/components/datetime/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { addDays, startOfHour, subDays } from "date-fns";
import {
addDays,
startOfHour,
startOfMinute,
subDays,
subHours,
subMinutes,
} from "date-fns";

import { assertUnreachable } from "@phoenix/typeUtils";

Expand All @@ -12,6 +19,21 @@ export function getTimeRangeFromLastNTimeRangeKey(
// We round down to facilitate caching.
const end = startOfHour(addDays(now, 365));
switch (key) {
case "15m":
return {
start: startOfMinute(subMinutes(now, 15)),
end,
};
case "1h":
return {
start: startOfMinute(subHours(now, 1)),
end,
};
case "12h":
return {
start: startOfHour(subHours(now, 12)),
end,
};
case "1d":
return {
start: startOfHour(subDays(now, 1)),
Expand Down
14 changes: 14 additions & 0 deletions app/src/store/preferencesStore.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { create, StateCreator } from "zustand";
import { devtools, persist } from "zustand/middleware";

import { LastNTimeRangeKey } from "@phoenix/components/datetime/types";

export type MarkdownDisplayMode = "text" | "markdown";

export interface PreferencesProps {
Expand All @@ -14,6 +16,10 @@ export interface PreferencesProps {
* @default true
*/
traceStreamingEnabled: boolean;
/**
* The last N time range to load data for
*/
lastNTimeRangeKey: LastNTimeRangeKey;
/**
* Whether or not to automatically refresh projects
* @default true
Expand Down Expand Up @@ -41,6 +47,10 @@ export interface PreferencesState extends PreferencesProps {
* @param traceStreamingEnabled
*/
setTraceStreamingEnabled: (traceStreamingEnabled: boolean) => void;
/**
* Setter for the last N time range to load data for
*/
setLastNTimeRangeKey: (lastNTimeRangeKey: LastNTimeRangeKey) => void;
/**
* Setter for enabling/disabling project auto refresh
* @param projectsAutoRefreshEnabled
Expand Down Expand Up @@ -70,6 +80,10 @@ export const createPreferencesStore = (
setTraceStreamingEnabled: (traceStreamingEnabled) => {
set({ traceStreamingEnabled });
},
lastNTimeRangeKey: "7d",
setLastNTimeRangeKey: (lastNTimeRangeKey) => {
set({ lastNTimeRangeKey });
},
projectsAutoRefreshEnabled: true,
setProjectAutoRefreshEnabled: (projectsAutoRefreshEnabled) => {
set({ projectsAutoRefreshEnabled });
Expand Down
12 changes: 12 additions & 0 deletions packages/phoenix-evals/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.16.0](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-evals-v0.15.1...arize-phoenix-evals-v0.16.0) (2024-09-17)


### Features

* OpenAI support for o1 preview ([#4633](https://github.com/Arize-ai/phoenix/issues/4633)) ([1ad7b79](https://github.com/Arize-ai/phoenix/commit/1ad7b79d95bd362ca15f34f2cebe7e1332a19846))


### Bug Fixes

* Ensure correct dataloader results ordering ([#4524](https://github.com/Arize-ai/phoenix/issues/4524)) ([f9239d6](https://github.com/Arize-ai/phoenix/commit/f9239d63af9d06c04430f9dca808caf08d152d3d))

## [0.15.1](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-evals-v0.15.0...arize-phoenix-evals-v0.15.1) (2024-08-27)


Expand Down
2 changes: 1 addition & 1 deletion packages/phoenix-evals/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
version = "0.15.1"
version = "0.16.0"
dependencies = [
"pandas",
"tqdm",
Expand Down
27 changes: 24 additions & 3 deletions packages/phoenix-evals/src/phoenix/evals/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class AzureOptions:
azure_ad_token_provider: Optional[Callable[[], str]]


def _model_supports_temperature(model: str) -> bool:
"""OpenAI 01 models do not support temperature."""
return "o1-" not in model


def _model_supports_max_tokens(model: str) -> bool:
"""OpenAI 01 models do not support max_tokens."""
return "o1-" not in model


@dataclass
class OpenAIModel(BaseModel):
"""
Expand Down Expand Up @@ -380,15 +390,26 @@ def invocation_params(self) -> Dict[str, Any]:
@property
def _default_params(self) -> Dict[str, Any]:
"""Get the default parameters for calling OpenAI API."""
return {
"temperature": self.temperature,
"max_tokens": self.max_tokens,
params = {
"frequency_penalty": self.frequency_penalty,
"presence_penalty": self.presence_penalty,
"top_p": self.top_p,
"n": self.n,
"timeout": self.request_timeout,
}
if _model_supports_max_tokens(self.model):
params.update(
{
"max_tokens": self.max_tokens,
}
)
if _model_supports_temperature(self.model):
params.update(
{
"temperature": self.temperature,
}
)
return params

@property
def supports_function_calling(self) -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ def test_llm_classify_prints_to_stdout_with_verbose_flag(
assert "Snapped '\\nrelevant ' to rail: relevant" in out, "Snapping events should be printed"
assert "Cannot snap 'unparsable' to rails" in out, "Snapping events should be printed"
assert "OpenAI invocation parameters" in out, "Model-specific information should be printed"
assert "'model': 'gpt-4', 'temperature': 0.0" in out, "Model information should be printed"
assert "'model': 'gpt-4'" in out, "Model information should be printed"
assert "'temperature': 0.0" in out, "Model information should be printed"
assert "sk-0123456789" not in out, "Credentials should not be printed out in cleartext"


Expand Down
7 changes: 7 additions & 0 deletions packages/phoenix-otel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.5.1](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-otel-v0.5.0...arize-phoenix-otel-v0.5.1) (2024-09-17)


### Bug Fixes

* Clarify type annotation ([#4626](https://github.com/Arize-ai/phoenix/issues/4626)) ([1931360](https://github.com/Arize-ai/phoenix/commit/1931360e839ee6f18d5722d94cf3a81224348aa8))

## [0.5.0](https://github.com/Arize-ai/phoenix/compare/arize-phoenix-otel-v0.4.1...arize-phoenix-otel-v0.5.0) (2024-09-12)


Expand Down
2 changes: 1 addition & 1 deletion packages/phoenix-otel/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
version = "0.5.0"
version = "0.5.1"
dependencies = [
"opentelemetry-semantic-conventions",
"opentelemetry-exporter-otlp",
Expand Down
5 changes: 5 additions & 0 deletions src/phoenix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
- Explore model performance, drift, and data quality metrics
"""

# The following line is needed to ensure that other modules using the
# `phoenix.*` path can be discovered by Bazel. For details,
# see: https://github.com/Arize-ai/openinference/issues/398
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

__all__ = [
"__version__",
"active_session",
Expand Down
8 changes: 8 additions & 0 deletions src/phoenix/trace/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ class TracesFixture:
),
)

demo_o1_preview_timeseries_testing_fixture = TracesFixture(
name="demo_o1_preview_timeseries_evals",
project_name="demo_o1_preview_timeseries",
description="Shows the traces for a timeseries evaluation of o1-preview",
file_name="o1-traces-preview-testing.parquet",
)

demo_llama_index_rag_llm_fixture = TracesFixture(
name="demo_llama_index_rag_llm",
project_name="demo_llama_index_rag_llm",
Expand Down Expand Up @@ -252,6 +259,7 @@ class TracesFixture:
TRACES_FIXTURES: List[TracesFixture] = [
demo_llama_index_rag_fixture,
demo_llama_index_rag_llm_fixture,
demo_o1_preview_timeseries_testing_fixture,
llama_index_rag_fixture,
llama_index_rag_fixture_with_davinci,
langchain_rag_stuff_document_chain_fixture,
Expand Down
2 changes: 1 addition & 1 deletion src/phoenix/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.33.2"
__version__ = "4.35.1"
Loading

0 comments on commit a357d1c

Please sign in to comment.