🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
Frontend iteration
Marc Klingen6dc74e8156c4
diff --git a/package-lock.json b/package-lock.jsonindex 737bcde304..54cc430c3b 100644--- a/package-lock.json+++ b/package-lock.json@@ -30,6 +30,7 @@"next-swagger-doc": "^0.3.6","react": "18.2.0","react-dom": "18.2.0",+ "react-icons": "^4.8.0","superjson": "1.12.2","swagger-ui-react": "^4.18.3","zod": "^3.21.4"@@ -66,7 +67,47 @@"url": "https://github.com/sponsors/sindresorhus"}},-<<<<<<< HEAD+ "node_modules/@apidevtools/json-schema-ref-parser": {+ "version": "9.1.2",+ "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz",+ "integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==",+ "dependencies": {+ "@jsdevtools/ono": "^7.1.3",+ "@types/json-schema": "^7.0.6",+ "call-me-maybe": "^1.0.1",+ "js-yaml": "^4.1.0"+ }+ },+ "node_modules/@apidevtools/openapi-schemas": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz",+ "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==",+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/@apidevtools/swagger-methods": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz",+ "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg=="+ },+ "node_modules/@apidevtools/swagger-parser": {+ "version": "10.0.3",+ "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz",+ "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==",+ "dev": true,+ "dependencies": {+ "@apidevtools/json-schema-ref-parser": "^9.0.6",+ "@apidevtools/openapi-schemas": "^2.0.4",+ "@apidevtools/swagger-methods": "^3.0.2",+ "@jsdevtools/ono": "^7.1.3",+ "call-me-maybe": "^1.0.1",+ "z-schema": "^5.0.1"+ },+ "peerDependencies": {+ "openapi-types": ">=7"+ }+ },"node_modules/@babel/code-frame": {"version": "7.21.4","resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",@@ -180,61 +221,31 @@},"engines": {"node": ">=4"-=======- "node_modules/@apidevtools/json-schema-ref-parser": {- "version": "9.1.2",- "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz",- "integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==",- "dependencies": {- "@jsdevtools/ono": "^7.1.3",- "@types/json-schema": "^7.0.6",- "call-me-maybe": "^1.0.1",- "js-yaml": "^4.1.0"- }- },- "node_modules/@apidevtools/openapi-schemas": {- "version": "2.1.0",- "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz",- "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==",- "engines": {- "node": ">=10"}},- "node_modules/@apidevtools/swagger-methods": {- "version": "3.0.2",- "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz",- "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg=="- },- "node_modules/@apidevtools/swagger-parser": {- "version": "10.0.3",- "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz",- "integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==",- "dev": true,+ "node_modules/@babel/runtime": {+ "version": "7.21.5",+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz",+ "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==","dependencies": {- "@apidevtools/json-schema-ref-parser": "^9.0.6",- "@apidevtools/openapi-schemas": "^2.0.4",- "@apidevtools/swagger-methods": "^3.0.2",- "@jsdevtools/ono": "^7.1.3",- "call-me-maybe": "^1.0.1",- "z-schema": "^5.0.1"+ "regenerator-runtime": "^0.13.11"},- "peerDependencies": {- "openapi-types": ">=7"->>>>>>> sdk+ "engines": {+ "node": ">=6.9.0"}},- "node_modules/@babel/runtime": {+ "node_modules/@babel/runtime-corejs3": {"version": "7.21.5",- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz",- "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==",+ "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.21.5.tgz",+ "integrity": "sha512-FRqFlFKNazWYykft5zvzuEl1YyTDGsIRrjV9rvxvYkUC7W/ueBng1X68Xd6uRMzAaJ0xMKn08/wem5YS1lpX8w==","dependencies": {+ "core-js-pure": "^3.25.1","regenerator-runtime": "^0.13.11"},"engines": {"node": ">=6.9.0"}},-<<<<<<< HEAD"node_modules/@babel/types": {"version": "7.21.5","resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz",@@ -243,28 +254,16 @@"@babel/helper-string-parser": "^7.21.5","@babel/helper-validator-identifier": "^7.19.1","to-fast-properties": "^2.0.0"-=======- "node_modules/@babel/runtime-corejs3": {- "version": "7.21.5",- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.21.5.tgz",- "integrity": "sha512-FRqFlFKNazWYykft5zvzuEl1YyTDGsIRrjV9rvxvYkUC7W/ueBng1X68Xd6uRMzAaJ0xMKn08/wem5YS1lpX8w==",- "dependencies": {- "core-js-pure": "^3.25.1",- "regenerator-runtime": "^0.13.11"->>>>>>> sdk},"engines": {"node": ">=6.9.0"}},-<<<<<<< HEAD-======="node_modules/@braintree/sanitize-url": {"version": "6.0.2","resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz","integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg=="},->>>>>>> sdk"node_modules/@cspotcode/source-map-support": {"version": "0.8.1","resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",@@ -580,6 +579,19 @@"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz","integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="},+ "node_modules/@jsdevtools/ono": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz",+ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg=="+ },+ "node_modules/@lukeed/csprng": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz",+ "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/@mui/base": {"version": "5.0.0-beta.1","resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.1.tgz",@@ -836,19 +848,6 @@"react-dom": "^17.0.2 || ^18.0.0"}},- "node_modules/@jsdevtools/ono": {- "version": "7.1.3",- "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz",- "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg=="- },- "node_modules/@lukeed/csprng": {- "version": "1.1.0",- "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz",- "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==",- "engines": {- "node": ">=8"- }- },"node_modules/@nestjs/axios": {"version": "0.0.8","resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-0.0.8.tgz",@@ -925,6 +924,21 @@"glob": "7.1.7"}},+ "node_modules/@next/swc-darwin-arm64": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.2.tgz",+ "integrity": "sha512-6BBlqGu3ewgJflv9iLCwO1v1hqlecaIH2AotpKfVUEzUxuuDNJQZ2a4KLb4MBl8T9/vca1YuWhSqtbF6ZuUJJw==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 10"+ }+ },"node_modules/@next/swc-darwin-x64": {"version": "13.4.2","resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.2.tgz",@@ -940,6 +954,111 @@"node": ">= 10"}},+ "node_modules/@next/swc-linux-arm64-gnu": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.2.tgz",+ "integrity": "sha512-2xVabFtIge6BJTcJrW8YuUnYTuQjh4jEuRuS2mscyNVOj6zUZkom3CQg+egKOoS+zh2rrro66ffSKIS+ztFJTg==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-linux-arm64-musl": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.2.tgz",+ "integrity": "sha512-wKRCQ27xCUJx5d6IivfjYGq8oVngqIhlhSAJntgXLt7Uo9sRT/3EppMHqUZRfyuNBTbykEre1s5166z+pvRB5A==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-linux-x64-gnu": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.2.tgz",+ "integrity": "sha512-NpCa+UVhhuNeaFVUP1Bftm0uqtvLWq2JTm7+Ta48+2Uqj2mNXrDIvyn1DY/ZEfmW/1yvGBRaUAv9zkMkMRixQA==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-linux-x64-musl": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.2.tgz",+ "integrity": "sha512-ZWVC72x0lW4aj44e3khvBrj2oSYj1bD0jESmyah3zG/3DplEy/FOtYkMzbMjHTdDSheso7zH8GIlW6CDQnKhmQ==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-win32-arm64-msvc": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.2.tgz",+ "integrity": "sha512-pLT+OWYpzJig5K4VKhLttlIfBcVZfr2+Xbjra0Tjs83NQSkFS+y7xx+YhCwvpEmXYLIvaggj2ONPyjbiigOvHQ==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-win32-ia32-msvc": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.2.tgz",+ "integrity": "sha512-dhpiksQCyGca4WY0fJyzK3FxMDFoqMb0Cn+uDB+9GYjpU2K5//UGPQlCwiK4JHxuhg8oLMag5Nf3/IPSJNG8jw==",+ "cpu": [+ "ia32"+ ],+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },+ "node_modules/@next/swc-win32-x64-msvc": {+ "version": "13.4.2",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.2.tgz",+ "integrity": "sha512-O7bort1Vld00cu8g0jHZq3cbSTUNMohOEvYqsqE10+yfohhdPHzvzO+ziJRz4Dyyr/fYKREwS7gR4JC0soSOMw==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 10"+ }+ },"node_modules/@nodelib/fs.scandir": {"version": "2.1.5","resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",@@ -1774,8 +1893,6 @@"version": "15.7.5","resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz","integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="-<<<<<<< HEAD-=======},"node_modules/@types/ramda": {"version": "0.29.0",@@ -1784,7 +1901,6 @@"dependencies": {"types-ramda": "^0.29.1"}->>>>>>> sdk},"node_modules/@types/react": {"version": "18.2.6",@@ -2423,8 +2539,6 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz","integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="-<<<<<<< HEAD-=======},"node_modules/base64-js": {"version": "1.5.1",@@ -2444,7 +2558,6 @@"url": "https://feross.org/support"}]->>>>>>> sdk},"node_modules/big-integer": {"version": "1.6.51",@@ -2781,14 +2894,6 @@"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz","integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="},-<<<<<<< HEAD- "node_modules/clsx": {- "version": "1.2.1",- "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",- "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",- "engines": {- "node": ">=6"-======="node_modules/cliui": {"version": "7.0.4","resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",@@ -2807,6 +2912,14 @@"node": ">=0.8"}},+ "node_modules/clsx": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",+ "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/code-point-at": {"version": "1.1.0","resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",@@ -2814,7 +2927,6 @@"optional": true,"engines": {"node": ">=0.10.0"->>>>>>> sdk}},"node_modules/color-convert": {@@ -2871,12 +2983,6 @@"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz","integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="},-<<<<<<< HEAD- "node_modules/convert-source-map": {- "version": "1.9.0",- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",- "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="-======="node_modules/concurrently": {"version": "6.5.1","resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz",@@ -2949,7 +3055,11 @@"engines": {"node": "> 0.10"}->>>>>>> sdk+ },+ "node_modules/convert-source-map": {+ "version": "1.9.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",+ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="},"node_modules/cookie": {"version": "0.5.0",@@ -2973,31 +3083,6 @@"url": "https://github.com/sponsors/mesqueeb"}},-<<<<<<< HEAD- "node_modules/cosmiconfig": {- "version": "7.1.0",- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",- "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",- "dependencies": {- "@types/parse-json": "^4.0.0",- "import-fresh": "^3.2.1",- "parse-json": "^5.0.0",- "path-type": "^4.0.0",- "yaml": "^1.10.0"- },- "engines": {- "node": ">=10"- }- },- "node_modules/cosmiconfig/node_modules/yaml": {- "version": "1.10.2",- "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",- "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",- "engines": {- "node": ">= 6"- }- },-======="node_modules/copy-to-clipboard": {"version": "3.3.3","resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz",@@ -3022,7 +3107,29 @@"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==","optional": true},->>>>>>> sdk+ "node_modules/cosmiconfig": {+ "version": "7.1.0",+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",+ "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",+ "dependencies": {+ "@types/parse-json": "^4.0.0",+ "import-fresh": "^3.2.1",+ "parse-json": "^5.0.0",+ "path-type": "^4.0.0",+ "yaml": "^1.10.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/cosmiconfig/node_modules/yaml": {+ "version": "1.10.2",+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",+ "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",+ "engines": {+ "node": ">= 6"+ }+ },"node_modules/create-require": {"version": "1.1.1","resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",@@ -3314,7 +3421,6 @@"node": ">=6.0.0"}},-<<<<<<< HEAD"node_modules/dom-helpers": {"version": "5.2.1","resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",@@ -3322,7 +3428,8 @@"dependencies": {"@babel/runtime": "^7.8.7","csstype": "^3.0.2"-=======+ }+ },"node_modules/dompurify": {"version": "3.0.2","resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.2.tgz",@@ -3342,7 +3449,6 @@"integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==","optionalDependencies": {"wcwidth": ">=1.0.1"->>>>>>> sdk}},"node_modules/electron-to-chromium": {@@ -4653,8 +4759,6 @@"url": "https://github.com/sponsors/ljharb"}},-<<<<<<< HEAD-======="node_modules/has-unicode": {"version": "2.0.1","resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",@@ -4694,7 +4798,6 @@"node": "*"}},->>>>>>> sdk"node_modules/hoist-non-react-statics": {"version": "3.3.2","resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",@@ -4796,8 +4899,6 @@"version": "2.0.4","resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz","integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="-<<<<<<< HEAD-=======},"node_modules/ini": {"version": "1.3.8",@@ -4829,7 +4930,6 @@"engines": {"node": ">=12.0.0"}->>>>>>> sdk},"node_modules/internal-slot": {"version": "1.0.5",@@ -5650,14 +5750,6 @@"url": "https://github.com/sponsors/sindresorhus"}},-<<<<<<< HEAD- "node_modules/mini-svg-data-uri": {- "version": "1.4.4",- "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",- "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",- "bin": {- "mini-svg-data-uri": "cli.js"-======="node_modules/mimic-response": {"version": "2.1.0","resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",@@ -5670,6 +5762,14 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/mini-svg-data-uri": {+ "version": "1.4.4",+ "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",+ "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",+ "bin": {+ "mini-svg-data-uri": "cli.js"+ }+ },"node_modules/minim": {"version": "0.23.8","resolved": "https://registry.npmjs.org/minim/-/minim-0.23.8.tgz",@@ -5679,7 +5779,6 @@},"engines": {"node": ">=6"->>>>>>> sdk}},"node_modules/minimatch": {@@ -6418,17 +6517,6 @@"node": ">=6"}},-<<<<<<< HEAD- "node_modules/parse-json": {- "version": "5.2.0",- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",- "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",- "dependencies": {- "@babel/code-frame": "^7.0.0",- "error-ex": "^1.3.1",- "json-parse-even-better-errors": "^2.3.0",- "lines-and-columns": "^1.1.6"-======="node_modules/parse-entities": {"version": "2.0.0","resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz",@@ -6446,6 +6534,23 @@"url": "https://github.com/sponsors/wooorm"}},+ "node_modules/parse-json": {+ "version": "5.2.0",+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",+ "dependencies": {+ "@babel/code-frame": "^7.0.0",+ "error-ex": "^1.3.1",+ "json-parse-even-better-errors": "^2.3.0",+ "lines-and-columns": "^1.1.6"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/patch-package": {"version": "6.5.1","resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.5.1.tgz",@@ -6509,7 +6614,6 @@"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==","bin": {"is-docker": "cli.js"->>>>>>> sdk},"engines": {"node": ">=8"@@ -6518,8 +6622,6 @@"url": "https://github.com/sponsors/sindresorhus"}},-<<<<<<< HEAD-======="node_modules/patch-package/node_modules/open": {"version": "7.4.2","resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",@@ -6608,7 +6710,6 @@"node": ">= 6"}},->>>>>>> sdk"node_modules/path-exists": {"version": "4.0.0","resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",@@ -7202,6 +7303,14 @@"react": "^18.2.0"}},+ "node_modules/react-icons": {+ "version": "4.8.0",+ "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.8.0.tgz",+ "integrity": "sha512-N6+kOLcihDiAnj5Czu637waJqSnwlMNROzVZMhfX68V/9bu9qHaMIJC4UdozWoOk57gahFCNHwVvWzm0MTzRjg==",+ "peerDependencies": {+ "react": "*"+ }+ },"node_modules/react-immutable-proptypes": {"version": "2.2.0","resolved": "https://registry.npmjs.org/react-immutable-proptypes/-/react-immutable-proptypes-2.2.0.tgz",@@ -7235,8 +7344,6 @@"version": "16.13.1","resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz","integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="-<<<<<<< HEAD-=======},"node_modules/react-redux": {"version": "8.0.5",@@ -7280,7 +7387,6 @@"version": "18.2.0","resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz","integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="->>>>>>> sdk},"node_modules/react-ssr-prepass": {"version": "1.5.0",@@ -7290,21 +7396,6 @@"react": "^16.8.0 || ^17.0.0 || ^18.0.0"}},-<<<<<<< HEAD- "node_modules/react-transition-group": {- "version": "4.4.5",- "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",- "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",- "dependencies": {- "@babel/runtime": "^7.5.5",- "dom-helpers": "^5.0.1",- "loose-envify": "^1.4.0",- "prop-types": "^15.6.2"- },- "peerDependencies": {- "react": ">=16.6.0",- "react-dom": ">=16.6.0"-======="node_modules/react-syntax-highlighter": {"version": "15.5.0","resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz",@@ -7318,7 +7409,21 @@},"peerDependencies": {"react": ">= 0.14.0"->>>>>>> sdk+ }+ },+ "node_modules/react-transition-group": {+ "version": "4.4.5",+ "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",+ "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",+ "dependencies": {+ "@babel/runtime": "^7.5.5",+ "dom-helpers": "^5.0.1",+ "loose-envify": "^1.4.0",+ "prop-types": "^15.6.2"+ },+ "peerDependencies": {+ "react": ">=16.6.0",+ "react-dom": ">=16.6.0"}},"node_modules/read-cache": {@@ -7418,8 +7523,6 @@"url": "https://github.com/sponsors/ljharb"}},-<<<<<<< HEAD-======="node_modules/remarkable": {"version": "2.0.1","resolved": "https://registry.npmjs.org/remarkable/-/remarkable-2.0.1.tgz",@@ -7464,7 +7567,6 @@"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="},->>>>>>> sdk"node_modules/reselect": {"version": "4.1.8","resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz",@@ -8464,14 +8566,6 @@"url": "https://github.com/sponsors/sindresorhus"}},-<<<<<<< HEAD- "node_modules/to-fast-properties": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",- "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",- "engines": {- "node": ">=4"-======="node_modules/tmp": {"version": "0.0.33","resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",@@ -8481,7 +8575,14 @@},"engines": {"node": ">=0.6.0"->>>>>>> sdk+ }+ },+ "node_modules/to-fast-properties": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",+ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",+ "engines": {+ "node": ">=4"}},"node_modules/to-regex-range": {@@ -9012,8 +9113,6 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz","integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="-<<<<<<< HEAD-=======},"node_modules/xml": {"version": "1.0.1",@@ -9043,7 +9142,6 @@"engines": {"node": ">=10"}->>>>>>> sdk},"node_modules/yallist": {"version": "4.0.0",diff --git a/package.json b/package.jsonindex 9c4f244c8f..9c60e97204 100644--- a/package.json+++ b/package.json@@ -34,6 +34,7 @@"next-swagger-doc": "^0.3.6","react": "18.2.0","react-dom": "18.2.0",+ "react-icons": "^4.8.0","superjson": "1.12.2","swagger-ui-react": "^4.18.3","zod": "^3.21.4"diff --git a/prisma/schema.prisma b/prisma/schema.prismaindex 18d2511a2d..8f6c5b840c 100644--- a/prisma/schema.prisma+++ b/prisma/schema.prisma@@ -76,18 +76,23 @@ model Trace {}model Observation {- id String @id @default(cuid())- traceId String- trace Trace @relation(fields: [traceId], references: [id], onDelete: Cascade)-- type String+ id String @id @default(cuid())+ traceId String+ trace Trace @relation(fields: [traceId], references: [id], onDelete: Cascade)+ type ObservationTypename String- startTime DateTime @map("start_time")- endTime DateTime @map("end_time")+ startTime DateTime @map("start_time")+ endTime DateTime @map("end_time")attributes Json- parentObservationId String? @map("parent_observation_id")- parent Observation? @relation("ParentChilds", fields: [parentObservationId], references: [id])- childs Observation[] @relation("ParentChilds")+ parentObservationId String? @map("parent_observation_id")+ parent Observation? @relation("ParentChilds", fields: [parentObservationId], references: [id])+ childs Observation[] @relation("ParentChilds")@@map("observations")}++enum ObservationType {+ SPAN+ EVENT+ LLMCALL+}diff --git a/prisma/seed.ts b/prisma/seed.tsindex 8d9c1b0b55..96f9ad2b69 100644--- a/prisma/seed.ts+++ b/prisma/seed.ts@@ -19,7 +19,7 @@ async function main() {data: {id: "57a266de-df34-4cea-b4e4-087bb6a3eac0",trace: { connect: { id: trace.id } },- type: "span",+ type: "SPAN",name: "sales-pilot-retrieval",attributes: {user: "[email protected]",@@ -29,6 +29,36 @@ async function main() {},});+ const llmCall = await prisma.observation.create({+ data: {+ id: "57a266de-df34-4cea-b4e4-678fdshj3678",+ trace: { connect: { id: trace.id } },+ type: "LLMCALL",+ name: "sales-pilot-retrieval-llm",+ attributes: {+ user: "[email protected]",+ prompt: "Hello world",+ completion: "Completion",+ tokens: {+ prompt: 2500,+ completion: 100,+ },+ model: {+ name: "gpt-3.5-turbo",+ provider: "OpenAI",+ temperature: 0,+ },+ },+ parent: {+ connect: {+ id: span.id,+ },+ },+ startTime: new Date(new Date().setMinutes(new Date().getMinutes() - 0.5)),+ endTime: new Date(),+ },+ });+console.log({ trace, span });}diff --git a/src/components/layouts/layout.tsx b/src/components/layouts/layout.tsxindex e576136942..54ce69cb0c 100644--- a/src/components/layouts/layout.tsx+++ b/src/components/layouts/layout.tsx@@ -15,11 +15,12 @@ import {} from "@heroicons/react/20/solid";import Link from "next/link";import { useRouter } from "next/router";+import { classNames } from "~/utils/tailwind";const navigationPaths = [{ name: "Dashboard", href: "/", icon: HomeIcon },{ name: "Traces", href: "/traces", icon: UsersIcon },- { name: "LLM Completions", href: "#", icon: DocumentDuplicateIcon },+ { name: "LLM Calls", href: "/llm-calls", icon: DocumentDuplicateIcon },];const teams = [{ id: 1, name: "Heroicons", href: "#", initial: "H", current: false },@@ -31,10 +32,6 @@ const userNavigation = [{ name: "Sign out", href: "#" },];-function classNames(...classes: string[]) {- return classes.filter(Boolean).join(" ");-}-export default function Layout(props: PropsWithChildren) {const [sidebarOpen, setSidebarOpen] = useState(false);const router = useRouter();diff --git a/src/pages/index.tsx b/src/pages/index.tsxindex c12c6ce3ea..e695008699 100644--- a/src/pages/index.tsx+++ b/src/pages/index.tsx@@ -1,83 +1,81 @@-import { type NextPage } from "next";-import Head from "next/head";-import Link from "next/link";-import { signIn, signOut, useSession } from "next-auth/react";+import { ChevronRightIcon } from "@heroicons/react/20/solid";+import { CommandLineIcon, MegaphoneIcon } from "@heroicons/react/24/outline";+import { SiPython } from "react-icons/si";+import { classNames } from "~/utils/tailwind";-import { api } from "~/utils/api";--const Home: NextPage = () => {- const hello = api.example.hello.useQuery({ text: "from tRPC" });+const items = [+ {+ name: "API reference",+ description: "Integrate with the langfuse REST API",+ href: "#",+ iconColor: "bg-purple-500",+ icon: MegaphoneIcon,+ },+ {+ name: "Typescript SDK",+ description: "npm install langfuse",+ href: "#",+ iconColor: "bg-blue-500",+ icon: CommandLineIcon,+ },+ {+ name: "Python SDK",+ description: "pip install langfuse",+ href: "#",+ iconColor: "bg-yellow-500",+ icon: SiPython,+ },+];+export default function Start() {return (- <>- <Head>- <title>Create T3 App</title>- <meta name="description" content="Generated by create-t3-app" />- <link rel="icon" href="/favicon.ico" />- </Head>- <main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c]">- <div className="container flex flex-col items-center justify-center gap-12 px-4 py-16 ">- <h1 className="text-5xl font-extrabold tracking-tight text-white sm:text-[5rem]">- Create <span className="text-[hsl(280,100%,70%)]">T3</span> App- </h1>- <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">- <Link- className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"- href="https://create.t3.gg/en/usage/first-steps"- target="_blank"- >- <h3 className="text-2xl font-bold">First Steps →</h3>- <div className="text-lg">- Just the basics - Everything you need to know to set up your- database and authentication.- </div>- </Link>- <Link- className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"- href="https://create.t3.gg/en/introduction"- target="_blank"- >- <h3 className="text-2xl font-bold">Documentation →</h3>- <div className="text-lg">- Learn more about Create T3 App, the libraries it uses, and how- to deploy it.- </div>- </Link>- </div>- <div className="flex flex-col items-center gap-2">- <p className="text-2xl text-white">- {hello.data ? hello.data.greeting : "Loading tRPC query..."}- </p>- <AuthShowcase />- </div>- </div>- </main>- </>- );-};--export default Home;--const AuthShowcase: React.FC = () => {- const { data: sessionData } = useSession();-- const { data: secretMessage } = api.example.getSecretMessage.useQuery(- undefined, // no input- { enabled: sessionData?.user !== undefined }- );-- return (- <div className="flex flex-col items-center justify-center gap-4">- <p className="text-center text-2xl text-white">- {sessionData && <span>Logged in as {sessionData.user?.name}</span>}- {secretMessage && <span> - {secretMessage}</span>}+ <div className="mx-auto max-w-lg">+ <h2 className="text-base font-semibold leading-6 text-gray-900">+ Integrate langfuse+ </h2>+ <p className="mt-1 text-sm text-gray-500">+ Use one of the following reference to start monitoring your application+ with langfuse application</p>- <button- className="rounded-full bg-white/10 px-10 py-3 font-semibold text-white no-underline transition hover:bg-white/20"- onClick={sessionData ? () => void signOut() : () => void signIn()}+ <ul+ role="list"+ className="mt-6 divide-y divide-gray-200 border-b border-t border-gray-200">- {sessionData ? "Sign out" : "Sign in"}- </button>+ {items.map((item, itemIdx) => (+ <li key={itemIdx}>+ <div className="group relative flex items-start space-x-3 py-4">+ <div className="flex-shrink-0">+ <span+ className={classNames(+ item.iconColor,+ "inline-flex h-10 w-10 items-center justify-center rounded-lg"+ )}+ >+ <item.icon+ className="h-6 w-6 text-white"+ aria-hidden="true"+ />+ </span>+ </div>+ <div className="min-w-0 flex-1">+ <div className="text-sm font-medium text-gray-900">+ <a href={item.href}>+ <span className="absolute inset-0" aria-hidden="true" />+ {item.name}+ </a>+ </div>+ <p className="text-sm text-gray-500">{item.description}</p>+ </div>+ <div className="flex-shrink-0 self-center">+ <ChevronRightIcon+ className="h-5 w-5 text-gray-400 group-hover:text-gray-500"+ aria-hidden="true"+ />+ </div>+ </div>+ </li>+ ))}+ </ul></div>);-};+}diff --git a/src/pages/llm-calls.tsx b/src/pages/llm-calls.tsxnew file mode 100644index 0000000000..df7a50fdb1--- /dev/null+++ b/src/pages/llm-calls.tsx@@ -0,0 +1,103 @@+import Header from "~/components/layouts/header";++import {+ DataGrid,+ type GridRowsProp,+ type GridColDef,+ type GridRowParams,+ GridToolbar,+} from "@mui/x-data-grid";+import { api } from "~/utils/api";+import { useRouter } from "next/router";++export default function Traces() {+ const llmCalls = api.llmCalls.all.useQuery();+ const router = useRouter();++ const columns: GridColDef[] = [+ {+ field: "id",+ type: "actions",+ headerName: "ID",+ width: 100,+ getActions: (params: GridRowParams) => [+ <button+ key="openLlmCall"+ className="rounded bg-indigo-50 px-2 py-1 text-xs font-semibold text-indigo-600 shadow-sm hover:bg-indigo-100"+ onClick={() =>+ void router.push(`/llm-calls/${params.row.id as string}`)+ }+ >+ ...{lastCharacters(params.row.id as string, 7)}+ </button>,+ ],+ },+ {+ field: "traceId",+ type: "actions",+ headerName: "Trace",+ width: 100,+ getActions: (params: GridRowParams) => [+ <button+ key="openTrace"+ className="rounded bg-indigo-50 px-2 py-1 text-xs font-semibold text-indigo-600 shadow-sm hover:bg-indigo-100"+ onClick={() =>+ void router.push(`/traces/${params.row.traceId as string}`)+ }+ >+ ...{lastCharacters(params.row.traceId as string, 7)}+ </button>,+ ],+ },+ {+ field: "startTime",+ type: "dateTime",+ headerName: "Start time",+ width: 170,+ },+ { field: "name", headerName: "Name", minWidth: 200 },+ {+ field: "prompt",+ headerName: "Prompt",+ flex: 1,+ },+ {+ field: "completion",+ headerName: "Completion",+ flex: 1,+ },+ {+ field: "model",+ headerName: "Model",+ flex: 1,+ },+ ];++ const rows: GridRowsProp = llmCalls.isSuccess+ ? llmCalls.data.map((llmCall) => ({+ id: llmCall.id,+ traceId: llmCall.traceId,+ startTime: llmCall.startTime,+ name: llmCall.name,+ prompt: llmCall.attributes.prompt,+ completion: llmCall.attributes.completion,+ model: JSON.stringify(llmCall.attributes.model),+ }))+ : [];++ return (+ <>+ <Header title="LLM Calls" />+ <DataGrid+ rows={rows}+ columns={columns}+ slots={{ toolbar: GridToolbar }}+ loading={llmCalls.isLoading}+ />+ </>+ );+}++function lastCharacters(str: string, n: number) {+ return str.substring(str.length - n);+}diff --git a/src/pages/llm-calls/[llmCallId].tsx b/src/pages/llm-calls/[llmCallId].tsxnew file mode 100644index 0000000000..eb13235c7e--- /dev/null+++ b/src/pages/llm-calls/[llmCallId].tsx@@ -0,0 +1,45 @@+import { useRouter } from "next/router";+import Header from "~/components/layouts/header";++import { api } from "~/utils/api";++export default function LlmCallPage() {+ const router = useRouter();+ const { llmCallId } = router.query;++ const llmCall = api.llmCalls.byId.useQuery(llmCallId as string, {+ enabled: llmCallId !== undefined,+ });++ return (+ <>+ <Header+ title="LLM Call"+ breadcrumb={[+ { name: "LLM Calls", href: "/llm-calls" },+ { name: llmCallId as string },+ ]}+ />+ {llmCall.isSuccess ? (+ <>+ <div className="flex w-full space-x-3">+ <div className="flex-1 border-2 border-gray-300 p-2">+ <div className="font-semibold">Prompt</div>+ {llmCall.data.attributes.prompt ?? ""}+ </div>+ <div className="flex-1 border-2 border-gray-300 p-2">+ <div className="font-semibold">Completion</div>+ {llmCall.data.attributes.completion ?? ""}+ </div>+ </div>+ <div className="mt-2">+ Tokens: {llmCall.data.attributes.tokens.prompt} prompt tokens,{" "}+ {llmCall.data.attributes.tokens.completion} completion tokens+ </div>+ </>+ ) : null}++ <pre>{JSON.stringify(llmCall.data, null, 2)}</pre>+ </>+ );+}diff --git a/src/pages/old-index.tsx b/src/pages/old-index.tsxnew file mode 100644index 0000000000..c12c6ce3ea--- /dev/null+++ b/src/pages/old-index.tsx@@ -0,0 +1,83 @@+import { type NextPage } from "next";+import Head from "next/head";+import Link from "next/link";+import { signIn, signOut, useSession } from "next-auth/react";++import { api } from "~/utils/api";++const Home: NextPage = () => {+ const hello = api.example.hello.useQuery({ text: "from tRPC" });++ return (+ <>+ <Head>+ <title>Create T3 App</title>+ <meta name="description" content="Generated by create-t3-app" />+ <link rel="icon" href="/favicon.ico" />+ </Head>+ <main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c]">+ <div className="container flex flex-col items-center justify-center gap-12 px-4 py-16 ">+ <h1 className="text-5xl font-extrabold tracking-tight text-white sm:text-[5rem]">+ Create <span className="text-[hsl(280,100%,70%)]">T3</span> App+ </h1>+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">+ <Link+ className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"+ href="https://create.t3.gg/en/usage/first-steps"+ target="_blank"+ >+ <h3 className="text-2xl font-bold">First Steps →</h3>+ <div className="text-lg">+ Just the basics - Everything you need to know to set up your+ database and authentication.+ </div>+ </Link>+ <Link+ className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"+ href="https://create.t3.gg/en/introduction"+ target="_blank"+ >+ <h3 className="text-2xl font-bold">Documentation →</h3>+ <div className="text-lg">+ Learn more about Create T3 App, the libraries it uses, and how+ to deploy it.+ </div>+ </Link>+ </div>+ <div className="flex flex-col items-center gap-2">+ <p className="text-2xl text-white">+ {hello.data ? hello.data.greeting : "Loading tRPC query..."}+ </p>+ <AuthShowcase />+ </div>+ </div>+ </main>+ </>+ );+};++export default Home;++const AuthShowcase: React.FC = () => {+ const { data: sessionData } = useSession();++ const { data: secretMessage } = api.example.getSecretMessage.useQuery(+ undefined, // no input+ { enabled: sessionData?.user !== undefined }+ );++ return (+ <div className="flex flex-col items-center justify-center gap-4">+ <p className="text-center text-2xl text-white">+ {sessionData && <span>Logged in as {sessionData.user?.name}</span>}+ {secretMessage && <span> - {secretMessage}</span>}+ </p>+ <button+ className="rounded-full bg-white/10 px-10 py-3 font-semibold text-white no-underline transition hover:bg-white/20"+ onClick={sessionData ? () => void signOut() : () => void signIn()}+ >+ {sessionData ? "Sign out" : "Sign in"}+ </button>+ </div>+ );+};diff --git a/src/pages/traces.tsx b/src/pages/traces.tsxindex 1195d39f11..ff5d80d27c 100644--- a/src/pages/traces.tsx+++ b/src/pages/traces.tsx@@ -74,6 +74,7 @@ export default function Traces() {rows={rows}columns={columns}slots={{ toolbar: GridToolbar }}+ loading={traces.isLoading}/></>);diff --git a/src/pages/traces/[traceId].tsx b/src/pages/traces/[traceId].tsxindex 081b94abb6..b6468b5586 100644--- a/src/pages/traces/[traceId].tsx+++ b/src/pages/traces/[traceId].tsx@@ -3,7 +3,7 @@ import Header from "~/components/layouts/header";import { api } from "~/utils/api";-export default function Trace() {+export default function TracePage() {const router = useRouter();const { traceId } = router.query;@@ -11,6 +11,15 @@ export default function Trace() {enabled: traceId !== undefined,});+ const obs =+ trace.data?.Observations.map(({ id, name, type, parentObservationId }) => ({+ id,+ name,+ type,+ parentId: parentObservationId ?? undefined,+ })) ?? [];+ const nestedObs = transformToNestedObservations(obs);+return (<><Header@@ -20,7 +29,74 @@ export default function Trace() {{ name: traceId as string },]}/>- <pre>{JSON.stringify(trace.data)}</pre>+ <div>+ {nestedObs.map((obs) => (+ <ObservationDisplay key={obs.id} obs={obs} />+ ))}+ </div>+ <pre>{JSON.stringify(nestedObs, null, 2)}</pre>+ <pre>{JSON.stringify(trace.data, null, 2)}</pre></>);}++function ObservationDisplay(props: { obs: NestedObservation }) {+ return (+ <div>+ <div>{props.obs.name}</div>+ <div className="ml-5">+ {props.obs.children.map((obs) => (+ <ObservationDisplay key={obs.name} obs={obs} />+ ))}+ </div>+ </div>+ );+}++type Observation = {+ id: string;+ name: string;+ type: string;+};++type UnnestedObservation = Observation & {+ parentId?: string;+};++type NestedObservation = Observation & {+ children: NestedObservation[];+};++function transformToNestedObservations(+ unnestedObservations: UnnestedObservation[]+): NestedObservation[] {+ const nestedObservationsMap: { [id: string]: NestedObservation } = {};++ unnestedObservations.forEach((obs) => {+ const { id, name, type, parentId } = obs;+ const nestedObservation: NestedObservation = {+ id,+ name,+ type,+ children: [],+ };++ nestedObservationsMap[id] = nestedObservation;++ if (parentId && (nestedObservationsMap[parentId] as NestedObservation)) {+ (nestedObservationsMap[parentId] as NestedObservation).children.push(+ nestedObservation+ );+ }+ });++ const rootObservations: NestedObservation[] = [];++ unnestedObservations.forEach((obs) => {+ if (!obs.parentId) {+ rootObservations.push(nestedObservationsMap[obs.id] as NestedObservation);+ }+ });++ return rootObservations;+}diff --git a/src/server/api/root.ts b/src/server/api/root.tsindex 4612582bb4..f4bfee1e5d 100644--- a/src/server/api/root.ts+++ b/src/server/api/root.ts@@ -1,6 +1,7 @@import { createTRPCRouter } from "~/server/api/trpc";import { exampleRouter } from "~/server/api/routers/example";import { traceRouter } from "./routers/traces";+import { llmCallRouter } from "./routers/llmCalls";/*** This is the primary router for your server.@@ -10,6 +11,7 @@ import { traceRouter } from "./routers/traces";export const appRouter = createTRPCRouter({example: exampleRouter,traces: traceRouter,+ llmCalls: llmCallRouter,});// export type definition of APIdiff --git a/src/server/api/routers/llmCalls.ts b/src/server/api/routers/llmCalls.tsnew file mode 100644index 0000000000..f6ff48d6a2--- /dev/null+++ b/src/server/api/routers/llmCalls.ts@@ -0,0 +1,34 @@+import { ObservationType } from "@prisma/client";+import { z } from "zod";++import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";+import { prisma } from "~/server/db";+import { type LlmCall } from "~/utils/types";++export const llmCallRouter = createTRPCRouter({+ all: publicProcedure.query(async () => {+ const llmCalls = (await prisma.observation.findMany({+ where: {+ type: "LLMCALL",+ },+ orderBy: {+ startTime: "desc",+ },+ })) as LlmCall[];++ console.log(llmCalls);++ return llmCalls;+ }),++ byId: publicProcedure.input(z.string()).query(async ({ input }) => {+ // also works for other observations+ const llmCall = (await prisma.observation.findUnique({+ where: {+ id: input,+ },+ })) as LlmCall;++ return llmCall;+ }),+});diff --git a/src/server/api/routers/traces.ts b/src/server/api/routers/traces.tsindex dd9c27f183..436257676b 100644--- a/src/server/api/routers/traces.ts+++ b/src/server/api/routers/traces.ts@@ -19,6 +19,9 @@ export const traceRouter = createTRPCRouter({where: {id: input,},+ include: {+ Observations: true,+ },});}),});diff --git a/src/utils/tailwind.ts b/src/utils/tailwind.tsnew file mode 100644index 0000000000..b14852ec60--- /dev/null+++ b/src/utils/tailwind.ts@@ -0,0 +1,3 @@+export function classNames(...classes: string[]) {+ return classes.filter(Boolean).join(" ");+}diff --git a/src/utils/types.ts b/src/utils/types.tsnew file mode 100644index 0000000000..53141fb7bf--- /dev/null+++ b/src/utils/types.ts@@ -0,0 +1,13 @@+import { type Observation, type Prisma } from "@prisma/client";++export type LlmCall = Observation & {+ attributes: {+ prompt?: string;+ completion?: string;+ tokens: {+ prompt?: number;+ completion?: number;+ };+ model: Prisma.JsonValue;+ };+};diff --git a/tsconfig.json b/tsconfig.jsonindex 03ebb748ae..8562de8576 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -29,5 +29,5 @@"**/*.cjs","**/*.mjs"],- "exclude": ["node_modules"]+ "exclude": ["node_modules", "sdk"]}