Repository navigation
The first release of the Statsig AI Java SDK, on Maven Central as com.statsig:ai-java. It requires Java 8+.
Features
- Prompts and agent configs:
getPromptreturns a prompt's live version and candidates for a user, andgetPromptMessagesrenders a version's messages with Mustache template variables.getAgentConfigreturns an agent's live version and candidates from itsagent:<name>parameter store. - Eval grades:
logEvalGraderecords a grade for a prompt version, joined to its trace. - Tracing:
Otel.initializesets up a tracer provider that exports spans to Statsig, without registering it as the global OpenTelemetry unless you opt in.withStatsigContextandwithStatsigEnvironmentadd the user, activity and environment to spans.GenAISpans.wrapandstartWorkflowrecord workflow and tool spans, andwithIncomingTraceContextjoins a caller's trace from itstraceparentheader. - Model call wrappers:
OpenAIWrapper.wrap,AnthropicWrapper.wrapandGeminiWrapper.wraprecord model calls as spans, with the same names and attributes as the Node SDK, including streaming and async calls. Message content is recorded only when you opt in. The Anthropic and Google Gen AI SDKs are optional: add them to your app only to use their wrappers. - Offline evals:
Eval.builder(...)runs a task over records and scores the results. Each record runs in its own trace and sends its latency and reported tokens.StatsigDataset.of(name, toRecord)runs it on an eval dataset from the console.
Included In This Release
- maggiepizzo - tool: Publish to Maven Central (#39)
- maggiepizzo - feat: Send latency and tokens with eval results (SSLABS-930) (#38)
- maggiepizzo - feat: Run Eval on a Statsig dataset (SSLABS-891) (#29)
- maggiepizzo - feat: Give each Eval record its own trace (SSLABS-890) (#28)
- maggiepizzo - feat: Add a Gemini wrapper (SSLABS-920) (#37)
- maggiepizzo - feat: Add an Anthropic wrapper (SSLABS-919) (#36)
- maggiepizzo - feat: Trace streaming, async, completions, embeddings, images and Responses calls (SSLABS-918) (#35)
- maggiepizzo - feat: Render prompts and tag spans with template variables (SSLABS-910) (#34)
- maggiepizzo - feat: Add agent configs (SSLABS-911) (#33)
- maggiepizzo - feat!: Add service resources, opt-in global registration and removeSharedInstance (SSLABS-913) (#32)
- maggiepizzo - feat!: Match Node's gen_ai span names, attributes and message format (SSLABS-912) (#31)
- maggiepizzo - fix!: Capture OpenAI message content only on opt-in (SSLABS-909) (#30)
- maggiepizzo - feat: Port Eval() (SSLABS-888) (#27)
- maggiepizzo - feat: Add wrap and startWorkflow for workflow and tool spans (SSLABS-883) (#26)
- maggiepizzo - refactor!: Rename PromptConfig to PromptVersion and fix the gen_ai event user (SSLABS-488) (#25)
- maggiepizzo - feat: Tag OpenAI spans with the active prompt version (SSLABS-881) (#24)
- maggiepizzo - feat: Add withStatsigContext and stamp user and environment context on spans (SSLABS-880) (#23)
- maggiepizzo - feat: Join eval grades to traces and export spans (SSLABS-488) (#22)
- cresten-stclair-amplitude - ci: migrate workflows to Blacksmith runners (#21)
- weihao-statsig - feat: add wrapper openai config options, add test (#18)
- weihao-statsig - chore: some lint fixes and some unit tests (#19)
- weihao-statsig - test: add mock scrapi setup and migrate tests (#17)
- weihao-statsig - feat: wrap openai client (#16)
- weihao-statsig - chore: add basic read me (#15)
- weihao-statsig - feat: basic setup for openai (#14)
- weihao-statsig - feat: add more around prompt and trace (#13)
- weihao-statsig - feat: add statsig otel (#12)
- weihao-statsig - refac: move files to its own folder (#11)
- weihao-statsig - feat: add StatsigOTLPTraceExporterOptions support (#10)
- weihao-statsig - feat: add inline targeting support (#9)
- weihao-statsig - feat: add logEvalGrade support (#8)
- weihao-statsig - feat: add prompt support (#7)
- weihao-statsig - refac: rename to init config (#6)
- weihao-statsig - refac: remove ai instance class, move to statsigAI (#5)
- weihao-statsig - feat: add prompt + add github test workflow (#4)
- weihao-statsig - chore: add lint check and fix all lints' (#3)
- weihao-statsig - feat: add ai instance related class (#2)
- weihao-statsig - chore: set up more structure (#1)
Full Changelog: https://github.com/statsig-io/statsig-ai-java/commits/0.0.1-beta.1