Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
feat: Add docs for Mistral and Azure OpenAI along with support in Ingester (#108)
Patcher9988b76d55588d
diff --git a/README.md b/README.mdindex f3b4352a..767ed492 100644--- a/README.md+++ b/README.md@@ -88,7 +88,7 @@ To install the Doku using Docker, follow these steps:restart: alwaysdoku-ingester:- image: ghcr.io/dokulabs/doku-ingester:0.1.0+ image: ghcr.io/dokulabs/doku-ingester:0.1.1container_name: doku-ingesterenvironment:DOKU_DB_HOST: clickhouse@@ -103,7 +103,7 @@ To install the Doku using Docker, follow these steps:restart: alwaysdoku-client:- image: ghcr.io/dokulabs/doku-client:0.1.0+ image: ghcr.io/dokulabs/doku-client:0.1.1container_name: doku-clientenvironment:INIT_DB_HOST: clickhousediff --git a/docs/0.1/connections/datadog.mdx b/docs/0.1/connections/datadog.mdxindex 22ac2ff7..c5a44ba0 100644--- a/docs/0.1/connections/datadog.mdx+++ b/docs/0.1/connections/datadog.mdx@@ -1,6 +1,6 @@---title: 'DataDog'-description: 'Connect Doku to DataDog'+description: 'LLM Observability with DataDog and Doku'---<Frame>@@ -865,3 +865,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/dynatrace.mdx b/docs/0.1/connections/dynatrace.mdxindex 364e2a37..0f74a591 100644--- a/docs/0.1/connections/dynatrace.mdx+++ b/docs/0.1/connections/dynatrace.mdx@@ -1,6 +1,6 @@---title: 'Dynatrace'-description: 'Connect Doku to Dynatrace'+description: 'LLM Observability with Dynatrace and Doku'---<Frame>@@ -1759,4 +1759,15 @@ curl --request POST \}}```-</Accordion>\ No newline at end of file+</Accordion>++---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/grafanacloud.mdx b/docs/0.1/connections/grafanacloud.mdxindex 2bdcb247..86eb4c73 100644--- a/docs/0.1/connections/grafanacloud.mdx+++ b/docs/0.1/connections/grafanacloud.mdx@@ -1,6 +1,6 @@---title: 'Grafana Cloud'-description: 'Connect Doku to Grafana Cloud'+description: 'LLM Observability with Grafana Cloud and Doku'---<Frame>@@ -2353,3 +2353,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/grafanaoss.mdx b/docs/0.1/connections/grafanaoss.mdxindex 1d607abc..1abff572 100644--- a/docs/0.1/connections/grafanaoss.mdx+++ b/docs/0.1/connections/grafanaoss.mdx@@ -1,6 +1,6 @@---title: 'Grafana OSS'-description: 'Connect Doku to Grafana OSS'+description: 'LLM Observability with Grafana and Doku'---<Frame>@@ -1933,3 +1933,13 @@ Grafana will attempt to connect to the database using the provided settings. If```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/intro.mdx b/docs/0.1/connections/intro.mdxindex ad56cc77..ed060e02 100644--- a/docs/0.1/connections/intro.mdx+++ b/docs/0.1/connections/intro.mdx@@ -28,7 +28,7 @@ Below is a list of observability platforms that work seamlessly with Doku:<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>Integrate your LLM Provider with Doku</Card>-<Card title="API Refernce" href="/0.1/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/new-relic.mdx b/docs/0.1/connections/new-relic.mdxindex f453d014..3a49a025 100644--- a/docs/0.1/connections/new-relic.mdx+++ b/docs/0.1/connections/new-relic.mdx@@ -1,6 +1,6 @@---title: 'New Relic'-description: 'Connect Doku to New Relic'+description: 'LLM Observability with New Relic and Doku'---<Frame>@@ -577,3 +577,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/connections/signoz.mdx b/docs/0.1/connections/signoz.mdxindex 6967ea47..a56d52aa 100644--- a/docs/0.1/connections/signoz.mdx+++ b/docs/0.1/connections/signoz.mdx@@ -1,6 +1,6 @@---title: 'SigNoz'-description: 'Connect Doku to SigNoz'+description: 'LLM Observability with SigNoz and Doku'---<Frame>@@ -1466,4 +1466,15 @@ curl --request POST \]}```-</Accordion>\ No newline at end of file+</Accordion>++---++<CardGroup cols={2}>+<Card title="Integrations" href="/0.1/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/installation.mdx b/docs/0.1/installation.mdxindex 35709ba7..f5e1a022 100644--- a/docs/0.1/installation.mdx+++ b/docs/0.1/installation.mdx@@ -1,6 +1,6 @@----title: 'Install Doku'-description: 'Deploy Doku in your preferred environment'+title: 'Installation'+description: 'Self-host Doku in your preferred environment'icon: 'circle-down'---@@ -37,7 +37,7 @@ Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://githu</Step><Step title="Installing the Helm Chart">```shell shell- helm install doku dokulabs/doku --version="0.1.0"+ helm install doku dokulabs/doku --version="0.1.1"```</Step></Steps>@@ -65,7 +65,7 @@ For a quick and straightforward setup, Docker Compose can be used to deploy Dokurestart: alwaysdoku-ingester:- image: ghcr.io/dokulabs/doku-ingester:0.1.0+ image: ghcr.io/dokulabs/doku-ingester:0.1.1container_name: doku-ingesterenvironment:DOKU_DB_HOST: clickhouse@@ -80,7 +80,7 @@ For a quick and straightforward setup, Docker Compose can be used to deploy Dokurestart: alwaysdoku-client:- image: ghcr.io/dokulabs/doku-client:0.1.0+ image: ghcr.io/dokulabs/doku-client:0.1.1container_name: doku-clientenvironment:INIT_DB_HOST: clickhousediff --git a/docs/0.1/integrations/anthropic/examples/messages.mdx b/docs/0.1/integrations/anthropic/examples/messages.mdxindex 780cc26f..24754e12 100644--- a/docs/0.1/integrations/anthropic/examples/messages.mdx+++ b/docs/0.1/integrations/anthropic/examples/messages.mdx@@ -1,9 +1,8 @@---title: 'Messages'-description: 'Monitor Anthropic Messages API Usage'+description: 'Monitor Anthropic `messages` API usage for cost, performance & user interactions'----## Completions<Tabs><Tab title="Python">@@ -14,7 +13,6 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = Anthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)@@ -22,13 +20,7 @@ description: 'Monitor Anthropic Messages API Usage'dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")message = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{ "role": "user", "content": "Hello, Explain LLM Monitoring in one sentence"}],model="claude-3-opus-20240229",)print(message.content)@@ -38,7 +30,6 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = Anthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)@@ -46,13 +37,7 @@ description: 'Monitor Anthropic Messages API Usage'dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")stream = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{"role": "user", "content": "Hello, Explain LLM Monitoring in one sentence"}],model="claude-3-opus-20240229",stream=True,)@@ -69,55 +54,41 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = AsyncAnthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-async def main() -> None:message = await client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{"role": "user","content": "Hello, How to monitor LLM Applications?"}],model="claude-3-opus-20240229",)+ print(message.content)asyncio.run(main())-```+```python streamingimport asynciofrom anthropic import AsyncAnthropicimport dokumetryclient = AsyncAnthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- async def main():- stream = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ async def main() -> None:+ stream = await client.messages.create(+ messages=[{"role": "user","content": "What metrics to monitor for my LLM Applications?"}],model="claude-3-opus-20240229",stream=True,)- for event in stream:+ async for event in stream:print(event.type)asyncio.run(main())@@ -131,7 +102,7 @@ description: 'Monitor Anthropic Messages API Usage'import DokuMetry from 'dokumetry';const anthropic = new Anthropic({- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+ apiKey: 'my_api_key',});// Pass the above `anthropic` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.@@ -139,8 +110,7 @@ description: 'Monitor Anthropic Messages API Usage'async function main() {const message = await anthropic.messages.create({- max_tokens: 1024,- messages: [{ role: 'user', content: 'Hello, Claude' }],+ messages: [{ role: 'user', content: 'How to monitor my LLM Applications?' }],model: 'claude-3-opus-20240229',});@@ -155,15 +125,14 @@ description: 'Monitor Anthropic Messages API Usage'import DokuMetry from 'dokumetry';const anthropic = new Anthropic({- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+ apiKey: 'my_api_key',});// Pass the above `anthropic` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const stream = await anthropic.messages.create({- max_tokens: 1024,- messages: [{ role: 'user', content: 'Hello, Claude' }],+ messages: [{ role: 'user', content: 'How to setup LLM Obserability?' }],model: 'claude-3-opus-20240229',stream: true,});diff --git a/docs/0.1/integrations/anthropic/introduction.mdx b/docs/0.1/integrations/anthropic/introduction.mdxindex 4bebbf29..87ddbe2e 100644--- a/docs/0.1/integrations/anthropic/introduction.mdx+++ b/docs/0.1/integrations/anthropic/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Anth## Get Started-The integration is compatible with Anthropic Python SDK version `>=0.19.0` and Typescript SDK version `>=0.9.0`+The integration is compatible with+- Anthropic Python SDK client `>=0.19.0`+- Anthropic JS/TS SDK client `>=0.9.0`<Tabs><Tab title="Python">```shell- pip install dokumetry==0.1.0+ pip install dokumetry==0.1.1``````python@@ -28,7 +30,7 @@ The integration is compatible with Anthropic Python SDK version `>=0.19.0` and T</Tab><Tab title="Javascript">```shell- npm install [email protected]+ npm install [email protected]``````javascript@@ -85,7 +87,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/0.1/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/0.1/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/0.1/integrations/azure-openai/examples/chat.mdx b/docs/0.1/integrations/azure-openai/examples/chat.mdxnew file mode 100644index 00000000..8edbec85--- /dev/null+++ b/docs/0.1/integrations/azure-openai/examples/chat.mdx@@ -0,0 +1,437 @@+---+title: 'Chat Completions'+description: 'Monitor Azure OpenAI `chat.completions` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage+ <CodeGroup>+ ```python Default+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ]+ )++ print(completion.choices[0].message)+ ```++ ```python Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream=True+ )++ for chunk in completion:+ print(chunk.choices[0].delta)+ ```++ ```python Functions+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ]+ messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]+ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=messages,+ tools=tools,+ tool_choice="auto"+ )++ print(completion)+ ```++ ```python LogProbs+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ logprobs=True,+ top_logprobs=2+ )++ print(completion.choices[0].message)+ print(completion.choices[0].logprobs)+ ```+ </CodeGroup>++ ### Asynchronous Usage++ <CodeGroup>+ ```python Default+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ chat_completion = await client.chat.completions.create(+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ model=azure_model_deployment,+ )++ asyncio.run(main())+ ```++ ```python Streaming+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main():+ stream = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream=True,+ )+ async for chunk in stream:+ print(chunk.choices[0].delta.content or "", end="")+++ asyncio.run(main())+ ```++ ```python Functions+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ]+ messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]++ async def main() -> None:+ completion = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=messages,+ tools=tools,+ tool_choice="auto"+ )++ asyncio.run(main())+ ```++ ```python LogProbs+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ completion = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ logprobs=True,+ top_logprobs=2+ )++ asyncio.run(main())+ ```+ </CodeGroup>+ </Tab>+ <Tab title="NodeJS">+ <CodeGroup>+ ```javascript Default+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ model: azureModelDeployment,+ });++ console.log(completion.choices[0]);+ }++ main();+ ```++ ```javascript Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ model: azureModelDeployment,+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream: true,+ });++ for await (const chunk of completion) {+ console.log(chunk.choices[0].delta.content);+ }+ }++ main();+ ```++ ```javascript Functions+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];+ const tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ];++ const response = await client.chat.completions.create({+ model: azureModelDeployment,+ messages: messages,+ tools: tools,+ tool_choice: "auto",+ });++ console.log(response);+ }++ main();+ ```++ ```javascript LogProbs+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my Azure OpenAI based LLM Applications?"}+ ],+ model: azureModelDeployment,+ logprobs: true,+ top_logprobs: 2,+ });++ console.log(completion.choices[0]);+ }++ main();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/azure-openai/examples/completions.mdx b/docs/0.1/integrations/azure-openai/examples/completions.mdxnew file mode 100644index 00000000..313a3a23--- /dev/null+++ b/docs/0.1/integrations/azure-openai/examples/completions.mdx@@ -0,0 +1,118 @@+---+title: 'Completions'+description: 'Monitor Azure OpenAI `completions` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">+ <CodeGroup>+ ```python No Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = client.completions.create(+ model=azure_model_deployment,+ prompt="What is LLM Observablity?",+ )++ print(respomse.choices[0].text)+ ```++ ```python Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = client.completions.create(+ model=azure_model_deployment,+ prompt="How to monitor LLM Applications?",+ stream=True+ )++ for chunk in respomse:+ print(chunk.choices[0].text)+ ```+ </CodeGroup>+ </Tab>+ <Tab title="NodeJS">+ <CodeGroup>+ ```javascript No Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await client.completions.create({+ model: azureModelDeployment,+ prompt: "How to monitor LLM Applications?",+ });++ console.log(response);+ }+ main();+ ```++ ```javascript Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await client.completions.create({+ model: azureModelDeployment,+ prompt: "How to monitor LLM Applications?",+ stream: true,+ });++ for await (const chunk of response) {+ console.log(chunk.choices[0].text)+ }+ }+ main();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/azure-openai/examples/embeddings.mdx b/docs/0.1/integrations/azure-openai/examples/embeddings.mdxnew file mode 100644index 00000000..c218f846--- /dev/null+++ b/docs/0.1/integrations/azure-openai/examples/embeddings.mdx@@ -0,0 +1,61 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings+<Tabs>+ <Tab title="Python">+ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ client.embeddings.create(+ model=azure_model_deployment,+ input="LLM monitoring",+ encoding_format="float"+ )+ ```+ </Tab>+ <Tab title="javascript">+ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async function main() {+ const embedding = await client.embeddings.create({+ model: azureModelDeployment,+ input: "The quick brown fox jumped over the lazy dog",+ encoding_format: "float",+ });++ console.log(embedding);+ }++ main();+ ```+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/azure-openai/examples/image.mdx b/docs/0.1/integrations/azure-openai/examples/image.mdxnew file mode 100644index 00000000..36074dd7--- /dev/null+++ b/docs/0.1/integrations/azure-openai/examples/image.mdx@@ -0,0 +1,60 @@+---+title: 'Image'+description: 'Monitor Azure OpenAI `image` API usage for cost, performance & user interactions'+---++## Create Image++<Tabs>+ <Tab title="Python">+ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ image = client.images.generate(+ model=azure_model_deployment,+ prompt="Create a dashboard for LLM Observability data",+ n=1,+ size="1024x1024"+ )++ print(image.data)+ ```+ </Tab>+ <Tab title="Javascript">+ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ async function main() {+ const image = await client.images.generate({+ model: azureModelDeployment,+ prompt: "Create a dashboard for LLM Observability data"+ });++ console.log(image.data);+ }+ main();+ ```+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/azure-openai/introduction.mdx b/docs/0.1/integrations/azure-openai/introduction.mdxnew file mode 100644index 00000000..2774476c--- /dev/null+++ b/docs/0.1/integrations/azure-openai/introduction.mdx@@ -0,0 +1,102 @@+---+title: 'Azure OpenAI Integration'+sidebarTitle: 'Get Started'+---++DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Azure OpenAI usage data and metrics from your Python/NodeJS code.++## Get Started++The integration is compatible with+- OpenAI Python SDK client `>=1.13.0`+- OpenAI JS/TS SDK client `>=4.28.0`++<Tabs>+ <Tab title="Python">+ ```shell+ pip install dokumetry==0.1.1+ ```++ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ dokumetry.init(llm = client, doku_url = "YOUR_DOKU_INGESTER_URL", api_key = "YOUR_DOKU_TOKEN")+ ```+ </Tab>+ <Tab title="Javascript">+ ```shell+ npm install [email protected]+ ```++ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </Tab>+</Tabs>++## Supported Endpoints++The following Azure OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/0.1/integrations/azure-openai/examples/chat)+- [Image Create](/0.1/integrations/azure-openai/examples/image#create-image)+- [Embeddings](/0.1/integrations/azure-openai/examples/embeddings)+- [Completions](/0.1/integrations/azure-openai/examples/completions)++## Parameters++<Tabs>+ <Tab title="Python">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Azure OpenAI Object to track | Yes |+ | doku_url | URL of your Doku Ingester | Yes |+ | api_key | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | application_name | Custom application name tag for your metrics | Optional |+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+ <Tab title="NodeJS">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Azure OpenAI Object to track | Yes |+ | dokuUrl | URL of your Doku Ingester | Yes |+ | apiKey | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | applicationName | Custom application name tag for your metrics | Optional |+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+</Tabs>++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.++---++<CardGroup cols={2}>+<Card title="Connections" href="/0.1/connections/intro" icon='link'>+Connect to your existing Observablity Platform+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/integrations/cohere/examples/chat.mdx b/docs/0.1/integrations/cohere/examples/chat.mdxdeleted file mode 100644index 0b9781d5..00000000--- a/docs/0.1/integrations/cohere/examples/chat.mdx+++ /dev/null@@ -1,108 +0,0 @@-----title: 'Chat'-description: 'Monitor Cohere Chat API usage'------## Chat-<Tabs>- <Tab title="Python">- <CodeGroup>- ```python No Streaming- import cohere- import dokumetry-- co = cohere.Client('<<apiKey>>')-- # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-- response = co.chat(- chat_history=[- {"role": "USER", "message": "Who discovered gravity?"},- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}- ],- message="What year was he born?",- # perform web search before answering the question. You can also use your own custom connector.- connectors=[{"id": "web-search"}]- )- print(response)- ```-- ```python Streaming- import cohere- import dokumetry-- co = cohere.Client('<<apiKey>>')-- # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-- response = co.chat(- chat_history=[- {"role": "USER", "message": "Who discovered gravity?"},- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}- ],- message="What year was he born?",- stream=True,- # perform web search before answering the question. You can also use your own custom connector.- connectors=[{"id": "web-search"}]- )- print(response)- ```- </CodeGroup>- </Tab>- <Tab title="Javascript">- <CodeGroup>- ```javascript No Streaming- import { CohereClient } from "cohere-ai";- import DokuMetry from 'dokumetry';-- const cohere = new CohereClient({- token: "<<apiKey>>",- });-- (async () => {- // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})-- const response = await cohere.chat({- message: 'Say this is a test',- model: 'command',- });-- console.log(response)- })();- ```-- ```javascript Streaming- import { CohereClient } from "cohere-ai";- import DokuMetry from 'dokumetry';-- const cohere = new CohereClient({- token: "<<apiKey>>",- });-- (async () => {- // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})-- const chatStream = await cohere.chatStream({- chatHistory: [- { role: "USER", message: "Who discovered gravity?" },- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }- ],- message: "What year was he born?",- // perform web search before answering the question. You can also use your own custom connector.- connectors: [{ id: "web-search" }],- });-- for await (const message of chatStream) {- if (message.eventType === "text-generation") {- console.log(message);- }- }- })();- ```- </CodeGroup>- </Tab>-</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/cohere/examples/cochat.mdx b/docs/0.1/integrations/cohere/examples/cochat.mdxnew file mode 100644index 00000000..fc07c39d--- /dev/null+++ b/docs/0.1/integrations/cohere/examples/cochat.mdx@@ -0,0 +1,107 @@+---+title: 'Chat'+description: 'Monitor Cohere `chat` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">+ <CodeGroup>+ ```python No Streaming+ import cohere+ import dokumetry++ co = cohere.Client("YOUR_COHERE_API_KEY")++ # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = co.chat(+ chat_history=[+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message="How to monitor LLM Applications?",+ )+ print(response.text)+ ```++ ```python Streaming+ import cohere+ import dokumetry++ co = cohere.Client("YOUR_COHERE_API_KEY")++ # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = co.chat(+ chat_history=[+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message="How to monitor LLM Applications?",+ stream=True,+ )+ for text in response:+ if text.eventType === "text-generation":+ print(text)+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Javascript">+ <CodeGroup>+ ```javascript No Streaming+ import { CohereClient } from "cohere-ai";+ import DokuMetry from 'dokumetry';++ const cohere = new CohereClient({+ token: "YOUR_COHERE_API_KEY",+ });++ (async () => {+ // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await cohere.chat({+ chatHistory: [+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message: "How to monitor LLM Applications?",+ model: 'command',+ });++ console.log(response.text)+ })();+ ```++ ```javascript Streaming+ import { CohereClient } from "cohere-ai";+ import DokuMetry from 'dokumetry';++ const cohere = new CohereClient({+ token: "YOUR_COHERE_API_KEY",+ });++ (async () => {+ // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await cohere.chatStream({+ chatHistory: [+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message: "How to monitor LLM Applications?",+ model: 'command',+ });+ for await (const message of response) {+ if (message.eventType === "text-generation") {+ console.log(message);+ }+ }+ })();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/0.1/integrations/cohere/examples/embed.mdx b/docs/0.1/integrations/cohere/examples/embed.mdxindex 38cbaea3..57a3835a 100644--- a/docs/0.1/integrations/cohere/examples/embed.mdx+++ b/docs/0.1/integrations/cohere/examples/embed.mdx@@ -3,20 +3,19 @@ title: 'Embed'description: 'Monitor Cohere Embed API usage'----## Embed<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")response = co.embed(- texts=['hello', 'goodbye'],+ texts=['LLM', 'Monitoring', 'Observability'],model='embed-english-v3.0',input_type='classification')@@ -29,7 +28,7 @@ description: 'Monitor Cohere Embed API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {@@ -37,7 +36,7 @@ description: 'Monitor Cohere Embed API usage'DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const embed = await cohere.embed({- texts: ["hello", "goodbye"],+ texts: ['LLM', 'Monitoring', 'Observability'],model: "embed-english-v3.0",inputType: "classification",});diff --git a/docs/0.1/integrations/cohere/examples/generate.mdx b/docs/0.1/integrations/cohere/examples/generate.mdxindex f75589ed..012c50d0 100644--- a/docs/0.1/integrations/cohere/examples/generate.mdx+++ b/docs/0.1/integrations/cohere/examples/generate.mdx@@ -1,22 +1,21 @@---title: 'Generate'-description: 'Monitor Cohere Generate API usage'+description: 'Monitor Cohere `generate` API usage for cost, performance & user interactions'----## Generate<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")response = co.generate(- prompt='Please explain to me how LLMs work',+ prompt='How to monitor my LLM Applications?',)print(response)```@@ -27,7 +26,7 @@ description: 'Monitor Cohere Generate API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {@@ -35,7 +34,7 @@ description: 'Monitor Cohere Generate API usage'DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const generate = await cohere.generate({- prompt: "Please explain to me how LLMs work",+ prompt: "What is LLM Monitoring?",});console.log(generate);diff --git a/docs/0.1/integrations/cohere/examples/summarize.mdx b/docs/0.1/integrations/cohere/examples/summarize.mdxindex cc5edf3d..3715c67b 100644--- a/docs/0.1/integrations/cohere/examples/summarize.mdx+++ b/docs/0.1/integrations/cohere/examples/summarize.mdx@@ -1,16 +1,15 @@---title: 'Summarize'-description: 'Monitor Cohere Summarize API usage'+description: 'Monitor Cohere `summarize` API usage for cost, performance & user interactions'----## Summarize<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")@@ -50,7 +49,7 @@ description: 'Monitor Cohere Summarize API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {diff --git a/docs/0.1/integrations/cohere/introduction.mdx b/docs/0.1/integrations/cohere/introduction.mdxindex af77858b..90bd57d3 100644--- a/docs/0.1/integrations/cohere/introduction.mdx+++ b/docs/0.1/integrations/cohere/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Cohe## Get Started-The integration is compatible with Cohere Python SDK version `>=5.0.0` and Typescript SDK version `>=7.6.0`+The integration is compatible with+- Cohere Python SDK client `>=5.0.0`+- Cohere JS/TS SDK client `>=7.6.0`<Tabs><Tab title="Python">```shell- pip install dokumetry==0.1.0+ pip install dokumetry==0.1.1``````python@@ -26,7 +28,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Types</Tab><Tab title="Javascript">```shell- npm install [email protected]+ npm install [email protected]``````javascript@@ -34,7 +36,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Typesimport DokuMetry from 'dokumetry';const co = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});DokuMetry.init({llm: co, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})@@ -45,7 +47,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Types## Supported EndpointsThe following Cohere Endpoints are supported for monitoring with DokuMetry-- [Chat](/0.1/integrations/cohere/examples/chat)+- [Chat](/0.1/integrations/cohere/examples/cochat)- [Generate](/0.1/integrations/cohere/examples/generate)- [Summarize](/0.1/integrations/cohere/examples/summarize)- [Embed](/0.1/integrations/cohere/examples/embed)@@ -86,7 +88,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/0.1/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/0.1/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/0.1/integrations/introduction.mdx b/docs/0.1/integrations/introduction.mdxindex 4ef64d10..fc483028 100644--- a/docs/0.1/integrations/introduction.mdx+++ b/docs/0.1/integrations/introduction.mdx@@ -6,7 +6,7 @@ description: 'Monitor LLM Costs, Tokens and Performance along with User InteractStart integrating and monitoring your applications with Doku effortlessly. Choose from a range of providers to **start tracking LLM performance, usage, and costs** without hassle.-<CardGroup cols={3}>+<CardGroup cols={2}><Cardtitle="OpenAI"href="/0.1/integrations/openai/introduction"@@ -23,7 +23,7 @@ Start integrating and monitoring your applications with Doku effortlessly. Choostitle="Cohere"href="/0.1/integrations/cohere/introduction"icon={- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">+ <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><g><g><g>@@ -48,7 +48,7 @@ Start integrating and monitoring your applications with Doku effortlessly. Choostitle="Anthropic"href="/0.1/integrations/anthropic/introduction"icon={- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">+ <svg viewBox="0 0 255 255" xmlns="http://www.w3.org/2000/svg"><path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path><path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path></svg>@@ -56,6 +56,42 @@ Start integrating and monitoring your applications with Doku effortlessly. ChoosiconType="duotone"></Card>+ <Card+ title="Azure OpenAI"+ href="/0.1/integrations/azure-openai/introduction"+ icon={+ <svg viewBox="0 0 525 525" xmlns="http://www.w3.org/2000/svg"><g>+ <path d="M52.091 10.225h40.684L50.541 135.361a6.5 6.5 0 01-6.146 4.412H12.732c-3.553 0-6.477-2.923-6.477-6.476 0-.704.115-1.403.34-2.07L45.944 14.638a6.501 6.501 0 016.147-4.415v.002z" transform="translate(2.076 1.626) scale(3.37462)"/><path d="M377.371 319.374H159.644c-5.527 0-10.076 4.549-10.076 10.077 0 2.794 1.164 5.466 3.206 7.37l139.901 130.577a21.986 21.986 0 0015.004 5.91H430.96l-53.589-153.934z"/><path d="M52.091 10.225a6.447 6.447 0 00-6.161 4.498L6.644 131.12a6.457 6.457 0 00-.38 2.185c0 3.548 2.92 6.468 6.469 6.468H45.23a6.95 6.95 0 005.328-4.531l7.834-23.089 27.985 26.102a6.622 6.622 0 004.165 1.518h36.395l-15.962-45.615-46.533.011 28.48-83.944H52.091z" transform="translate(2.076 1.626) scale(3.37462)"/><path d="M104.055 14.631a6.492 6.492 0 00-6.138-4.406H52.575a6.493 6.493 0 016.138 4.406l39.35 116.594c.225.668.34 1.367.34 2.072 0 3.554-2.924 6.478-6.478 6.478h45.344c3.553-.001 6.476-2.925 6.476-6.478 0-.705-.115-1.404-.34-2.072l-39.35-116.594z" transform="translate(2.076 1.626) scale(3.37462)"/></g><defs><linearGradient id="prefix___Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(108.701 26.35 33.911) scale(131.7791)"><stop offset="0"/><stop offset="1"/></linearGradient><linearGradient id="prefix___Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(161.318 33.644 45.587) scale(10.31703)"><stop offset="0"/><stop offset=".07"/><stop offset=".32"/><stop offset=".62"/><stop offset="1"/></linearGradient><linearGradient id="prefix___Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(69.426 25.69 62.036) scale(131.9816)"><stop offset="0"/><stop offset="1"/></linearGradient></defs>+ </svg>+ }+ iconType="duotone"+ >+ </Card>+ <Card+ title="Mistral"+ href="/0.1/integrations/mistral/introduction"+ icon={+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 355 355">+ <path d="M0 0 C27.39 0 54.78 0 83 0 C83 17.82 83 35.64 83 54 C100.82 54 118.64 54 137 54 C137 71.82 137 89.64 137 108 C145.58 108 154.16 108 163 108 C163 90.18 163 72.36 163 54 C180.82 54 198.64 54 217 54 C217 36.18 217 18.36 217 0 C244.39 0 271.78 0 300 0 C300 90.09 300 180.18 300 273 C272.61 273 245.22 273 217 273 C217 237.36 217 201.72 217 165 C208.75 165 200.5 165 192 165 C192 182.82 192 200.64 192 219 C164.28 219 136.56 219 108 219 C108 201.18 108 183.36 108 165 C99.75 165 91.5 165 83 165 C83 200.64 83 236.28 83 273 C55.61 273 28.22 273 0 273 C0 182.91 0 92.82 0 0 Z "/>+ <path d="M0 0 C27.39 0 54.78 0 83 0 C83 35.97 83 71.94 83 109 C37.79 109 -7.42 109 -54 109 C-54 90.85 -54 72.7 -54 54 C-36.18 54 -18.36 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ <path d="M0 0 C18.48 0 36.96 0 56 0 C56 17.82 56 35.64 56 54 C73.82 54 91.64 54 110 54 C110 72.15 110 90.3 110 109 C73.7 109 37.4 109 0 109 C0 73.03 0 37.06 0 0 Z "/>+ <path d="M0 0 C8.91 0 17.82 0 27 0 C27 90.09 27 180.18 27 273 C18.09 273 9.18 273 0 273 C0 182.91 0 92.82 0 0 Z " transform="translate(0,0)"/>+ <path d="M0 0 C9.57 0 19.14 0 29 0 C29 17.82 29 35.64 29 54 C46.82 54 64.64 54 83 54 C83 72.15 83 90.3 83 109 C55.61 109 28.22 109 0 109 C0 73.03 0 37.06 0 0 Z "/>+ <path d="M0 0 C1.01154144 -0.00311188 2.02308289 -0.00622375 3.0652771 -0.00942993 C4.7290892 -0.00645401 4.7290892 -0.00645401 6.42651367 -0.00341797 C7.57181549 -0.00473724 8.71711731 -0.00605652 9.89712524 -0.00741577 C13.62960487 -0.0093378 17.3620104 -0.00299456 21.09448242 0.00439453 C22.34907257 0.00528076 23.60366272 0.00616699 24.89627075 0.00708008 C42.72160294 0.02199104 60.47499934 0.28646042 78.28198242 1.12939453 C78.28198242 19.27939453 78.28198242 37.42939453 78.28198242 56.12939453 C50.56198242 56.12939453 22.84198242 56.12939453 -5.71801758 56.12939453 C-5.73864258 47.07501953 -5.75926758 38.02064453 -5.78051758 28.69189453 C-5.79417358 24.39847046 -5.79417358 24.39847046 -5.80810547 20.01831055 C-5.8110244 17.76497444 -5.81357301 15.5116378 -5.81567383 13.25830078 C-5.82078979 12.07586792 -5.82590576 10.89343506 -5.83117676 9.6751709 C-5.83129761 8.55864136 -5.83141846 7.44211182 -5.83154297 6.29174805 C-5.83376358 5.31689957 -5.83598419 4.34205109 -5.83827209 3.33766174 C-5.61659259 -0.73310076 -3.57396693 0.00319344 0 0 Z "/>+ <path d="M0 0 C0.33 0 0.66 0 1 0 C1 35.97 1 71.94 1 109 C19.15 109 37.3 109 56 109 C56 127.15 56 145.3 56 164 C37.52 164 19.04 164 0 164 C0 109.88 0 55.76 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 35.97 28 71.94 28 109 C18.76 109 9.52 109 0 109 C0 73.03 0 37.06 0 0 Z " transform="translate(217,164)"/>+ <path d="M0 0 C18.15 0 36.3 0 55 0 C55.020625 8.889375 55.04125 17.77875 55.0625 26.9375 C55.071604 29.74757568 55.08070801 32.55765137 55.09008789 35.45288086 C55.09300683 37.66520134 55.09555544 39.87752235 55.09765625 42.08984375 C55.10277222 43.25068481 55.10788818 44.41152588 55.11315918 45.60754395 C55.11334045 47.25188416 55.11334045 47.25188416 55.11352539 48.92944336 C55.115746 49.88652695 55.11796661 50.84361053 55.12025452 51.82969666 C55 54 55 54 54 55 C52.31198015 55.09353163 50.62004793 55.11744791 48.92944336 55.11352539 C47.83321655 55.11340454 46.73698975 55.11328369 45.60754395 55.11315918 C44.44670288 55.10804321 43.28586182 55.10292725 42.08984375 55.09765625 C41.02930786 55.09664917 39.96877197 55.09564209 38.87609863 55.09460449 C34.89655483 55.08935387 30.91702638 55.07539276 26.9375 55.0625 C18.048125 55.041875 9.15875 55.02125 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C7.33845237 -0.02590394 14.6768925 -0.04309155 22.01538086 -0.05493164 C24.49845825 -0.05988087 26.98153287 -0.0666419 29.46459961 -0.07543945 C47.00774093 -0.13592078 64.47120007 0.2552166 82 1 C82 18.82 82 36.64 82 55 C64.18 55 46.36 55 28 55 C28 37.18 28 19.36 28 1 C18.76 1 9.52 1 0 1 C0 0.67 0 0.34 0 0 Z "/>+ <path d="M0 0 C18.15 0 36.3 0 55 0 C55 17.82 55 35.64 55 54 C36.85 54 18.7 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ <path d="M0 0 C17.82 0 35.64 0 54 0 C54 18.15 54 36.3 54 55 C36.18 55 18.36 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 18.15 28 36.3 28 55 C18.76 55 9.52 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 18.15 28 36.3 28 55 C18.76 55 9.52 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 17.82 28 35.64 28 54 C18.76 54 9.52 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ </svg>+ }+ iconType="duotone"+ >+ </Card></CardGroup>---diff --git a/docs/0.1/integrations/mistral/examples/embedding.mdx b/docs/0.1/integrations/mistral/examples/embedding.mdxnew file mode 100644index 00000000..a9a3dc71--- /dev/null+++ b/docs/0.1/integrations/mistral/examples/embedding.mdx@@ -0,0 +1,79 @@+---+title: 'Embedding'+description: 'Monitor Mistral Embedding API Usage'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage++ ```python default+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.embeddings(+ model="mistral-embed",+ input=["Monitor LLM Applications"]+ )+ print(response)+ ```++ ### Asynchronous usage+ ```python default+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ mistral.embeddings(+ model="mistral-embed",+ input=["Monitor LLM Applications"]+ )++ print(response)++ asyncio.run(main())+ ```+ </Tab>+ <Tab title="Javascript">++ ```javascript default+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const input = [];+ for (let i = 0; i < 1; i++) {+ input.push('LLM Monitoring');+ }+ const embeddingsBatchResponse = await mistral.embeddings({+ model: 'mistral-embed',+ input: input,+ });+ }++ main();+ ```+ </Tab>+</Tabs>+diff --git a/docs/0.1/integrations/mistral/examples/mistral-chat.mdx b/docs/0.1/integrations/mistral/examples/mistral-chat.mdxnew file mode 100644index 00000000..cde33eaf--- /dev/null+++ b/docs/0.1/integrations/mistral/examples/mistral-chat.mdx@@ -0,0 +1,142 @@+---+title: 'Chat'+description: 'Monitor Mistral `chat` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage+ <CodeGroup>+ ```python default+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.chat(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ print(response)+ ```++ ```python streaming+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.chat_stream(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ for chunk in response:+ print(chunk)+ ```+ </CodeGroup>++ ### Asynchronous usage+ <CodeGroup>+ ```python default+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ response = mistral.chat(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ print(message)++ asyncio.run(main())+ ```++ ```python streaming+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ response = mistral.chat_stream(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ for chunk in response:+ print(chunk)++ asyncio.run(main())+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Javascript">+ <CodeGroup>++ ```javascript default+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await mistral.chat({+ model: 'mistral-small-latest',+ messages: [{role: 'user', content: 'What is LLM Observability?'}],+ });++ console.log(response);+ }++ main();+ ```++ ```javascript streaming+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await mistral.chatStream({+ model: 'mistral-small-latest',+ messages: [{role: 'user', content: 'What is LLM Observability?'}],+ });++ for await (const message of response) {+ console.log(message)+ }+ ```+ </CodeGroup>+ </Tab>+</Tabs>+diff --git a/docs/0.1/integrations/mistral/introduction.mdx b/docs/0.1/integrations/mistral/introduction.mdxnew file mode 100644index 00000000..f79022c9--- /dev/null+++ b/docs/0.1/integrations/mistral/introduction.mdx@@ -0,0 +1,92 @@+---+title: 'Mistral Integration'+sidebarTitle: 'Get Started'+---++DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Mistral usage data and metrics from your Python/NodeJS code.++## Get Started++The integration is compatible with+- Mistral Python SDK client `>=0.1.0`+- Mistral JS/TS SDK client `>=0.1.0`++<Tabs>+ <Tab title="Python">+ ```shell+ pip install dokumetry==0.1.1+ ```++ ```python+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ dokumetry.init(llm = Mistral, doku_url = "YOUR_DOKU_INGESTER_URL", api_key = "YOUR_DOKU_TOKEN")+ ```+ </Tab>+ <Tab title="Javascript">+ ```shell+ npm install [email protected]+ ```++ ```javascript+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </Tab>+</Tabs>++## Supported Endpoints++The following Mistral Endpoints are supported for monitoring with DokuMetry++- [chat](/0.1/integrations/mistral/examples/mistral-chat)+- [embedding](/0.1/integrations/mistral/examples/embedding)++## Parameters+<Tabs>+ <Tab title="Python">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Mistral Object to track | Yes |+ | doku_url | URL of your Doku Ingester | Yes |+ | api_key | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | application_name | Custom application name tag for your metrics | Optional |+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+ <Tab title="NodeJS">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Mistral Object to track | Yes |+ | dokuUrl | URL of your Doku Ingester | Yes |+ | apiKey | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | applicationName | Custom application name tag for your metrics | Optional |+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+</Tabs>++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.++---++<CardGroup cols={2}>+<Card title="Connections" href="/0.1/connections/intro" icon='link'>+Connect to your existing Observablity Platform+</Card>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/0.1/integrations/openai/examples/audio.mdx b/docs/0.1/integrations/openai/examples/audio.mdxindex d6b7ffac..7a1108c2 100644--- a/docs/0.1/integrations/openai/examples/audio.mdx+++ b/docs/0.1/integrations/openai/examples/audio.mdx@@ -21,9 +21,9 @@ description: 'Monitor OpenAI Audio API usage'speech_file_path = Path(__file__).parent / "speech.mp3"response = client.audio.speech.create(- model="tts-1",- voice="alloy",- input="The quick brown fox jumped over the lazy dog."+ model= "tts-1",+ voice= "alloy",+ input= "The quick brown fox jumped over the lazy dog.")response.stream_to_file(speech_file_path)```diff --git a/docs/0.1/integrations/openai/examples/chat.mdx b/docs/0.1/integrations/openai/examples/chatCompletions.mdxsimilarity index 87%rename from docs/0.1/integrations/openai/examples/chat.mdxrename to docs/0.1/integrations/openai/examples/chatCompletions.mdxindex 4894c512..f4770f05 100644--- a/docs/0.1/integrations/openai/examples/chat.mdx+++ b/docs/0.1/integrations/openai/examples/chatCompletions.mdx@@ -1,9 +1,8 @@---title: 'Chat Completions'-description: 'Monitor OpenAI Chat Completions API usage'+description: 'Monitor OpenAI `chat.completions` API usage for cost, performance & user interactions'----<Tabs><Tab title="Python">@@ -23,8 +22,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}])@@ -76,8 +75,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],stream=True)@@ -142,7 +141,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],logprobs=True,top_logprobs=2@@ -171,10 +171,8 @@ description: 'Monitor OpenAI Chat Completions API usage'async def main() -> None:chat_completion = await client.chat.completions.create(messages=[- {- "role": "user",- "content": "Say this is a test",- }+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],model="gpt-3.5-turbo",)@@ -230,7 +228,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async def main():stream = await client.chat.completions.create(model="gpt-4",- messages=[{"role": "user", "content": "Say this is a test"}],+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],stream=True,)async for chunk in stream:@@ -301,7 +302,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = await client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],logprobs=True,top_logprobs=2@@ -324,7 +326,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async function main() {const completion = await openai.chat.completions.create({- messages: [{ role: "system", content: "You are a helpful assistant." }],+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],model: "gpt-3.5-turbo",});@@ -378,8 +383,8 @@ description: 'Monitor OpenAI Chat Completions API usage'const completion = await openai.chat.completions.create({model: "gpt-3.5-turbo",messages: [- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],stream: true,});@@ -448,7 +453,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async function main() {const completion = await openai.chat.completions.create({- messages: [{ role: "user", content: "Hello!" }],+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],model: "gpt-3.5-turbo",logprobs: true,top_logprobs: 2,diff --git a/docs/0.1/integrations/openai/examples/completions.mdx b/docs/0.1/integrations/openai/examples/completions.mdxindex 89f9f54c..07a00c0d 100644--- a/docs/0.1/integrations/openai/examples/completions.mdx+++ b/docs/0.1/integrations/openai/examples/completions.mdx@@ -1,6 +1,6 @@---title: 'Completions'-description: 'Monitor OpenAI Completions API Usage'+description: 'Monitor OpenAI `completions` API usage for cost, performance & user interactions'---<Tabs>@@ -17,12 +17,12 @@ description: 'Monitor OpenAI Completions API Usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- client.completions.create(+ response = client.completions.create(model="gpt-3.5-turbo-instruct",- prompt="Say this is a test",- max_tokens=7,- temperature=0+ prompt="What is LLM Observablity?",)++ print(respomse.choices[0].text)``````python Streaming@@ -36,15 +36,14 @@ description: 'Monitor OpenAI Completions API Usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- for chunk in client.completions.create(+ response = client.completions.create(model="gpt-3.5-turbo-instruct",- prompt="Say this is a test",- max_tokens=7,- temperature=0,+ prompt="How to monitor LLM Applications?",stream=True- ):+ )- print(chunk.choices[0].text)+ for chunk in respomse:+ print(chunk.choices[0].text)```</CodeGroup></Tab>@@ -60,14 +59,12 @@ description: 'Monitor OpenAI Completions API Usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const completion = await openai.completions.create({+ const response = await openai.completions.create({model: "gpt-3.5-turbo-instruct",- prompt: "Say this is a test.",- max_tokens: 7,- temperature: 0,+ prompt: "How to monitor LLM Applications?",});- console.log(completion);+ console.log(response);}main();```@@ -82,13 +79,13 @@ description: 'Monitor OpenAI Completions API Usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const stream = await openai.completions.create({+ const response = await openai.completions.create({model: "gpt-3.5-turbo-instruct",- prompt: "Say this is a test.",+ prompt: "How to monitor LLM Applications?",stream: true,});- for await (const chunk of stream) {+ for await (const chunk of response) {console.log(chunk.choices[0].text)}}diff --git a/docs/0.1/integrations/openai/examples/image.mdx b/docs/0.1/integrations/openai/examples/image.mdxindex e92e2b3c..f327ebf1 100644--- a/docs/0.1/integrations/openai/examples/image.mdx+++ b/docs/0.1/integrations/openai/examples/image.mdx@@ -1,6 +1,6 @@---title: 'Image'-description: 'Monitor OpenAI Image API usage'+description: 'Monitor OpenAI `image` API usage for cost, performance & user interactions'---## Create Image@@ -18,12 +18,14 @@ description: 'Monitor OpenAI Image API usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- client.images.generate(+ image = client.images.generate(model="dall-e-3",- prompt="A cute baby sea otter",+ prompt="Create a dashboard for LLM Observability data",n=1,size="1024x1024")++ print(image.data)```</Tab><Tab title="Javascript">@@ -37,7 +39,7 @@ description: 'Monitor OpenAI Image API usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });+ const image = await openai.images.generate({ model: "dall-e-3", prompt: "Create a dashboard for LLM Observability data" });console.log(image.data);}diff --git a/docs/0.1/integrations/openai/introduction.mdx b/docs/0.1/integrations/openai/introduction.mdxindex 8d993e88..0a03cc63 100644--- a/docs/0.1/integrations/openai/introduction.mdx+++ b/docs/0.1/integrations/openai/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Open## Get Started-The integration is compatible with OpenAI Python SDK version `>=1.13.0` and NodeJS SDK `>=4.28.0`+The integration is compatible with+- OpenAI Python SDK client `>=1.13.0`+- OpenAI JS/TS SDK client `>=4.28.0`<Tabs><Tab title="Python">```shell- pip install dokumetry==0.1.0+ pip install dokumetry==0.1.1``````python@@ -26,7 +28,7 @@ The integration is compatible with OpenAI Python SDK version `>=1.13.0` and Node</Tab><Tab title="Javascript">```shell- npm install [email protected]+ npm install [email protected]``````javascript@@ -44,7 +46,7 @@ The integration is compatible with OpenAI Python SDK version `>=1.13.0` and NodeThe following OpenAI Endpoints are supported for monitoring with DokuMetry-- [Chat completions](/0.1/integrations/openai/examples/chat)+- [Chat completions](/0.1/integrations/openai/examples/chatCompletions)- [Image Create](/0.1/integrations/openai/examples/image#create-image) and [Image Variations](/0.1/integrations/openai/examples/image#create-image-variation)- [Audio Speech Create](/0.1/integrations/openai/examples/audio)- [Embeddings](/0.1/integrations/openai/examples/embeddings)@@ -87,7 +89,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/0.1/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/0.1/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/0.1/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/0.1/quickstart.mdx b/docs/0.1/quickstart.mdxindex 855534ee..36034f5b 100644--- a/docs/0.1/quickstart.mdx+++ b/docs/0.1/quickstart.mdx@@ -28,7 +28,7 @@ This guide will walk you through setting up monitoring for your LLM Applicationrestart: alwaysdoku-ingester:- image: ghcr.io/dokulabs/doku-ingester:0.1.0+ image: ghcr.io/dokulabs/doku-ingester:0.1.1container_name: doku-ingesterenvironment:DOKU_DB_HOST: clickhouse@@ -43,7 +43,7 @@ This guide will walk you through setting up monitoring for your LLM Applicationrestart: alwaysdoku-client:- image: ghcr.io/dokulabs/doku-client:0.1.0+ image: ghcr.io/dokulabs/doku-client:0.1.1container_name: doku-clientenvironment:INIT_DB_HOST: clickhouse@@ -80,7 +80,7 @@ This guide will walk you through setting up monitoring for your LLM Application- Password as `dokulabsuser`3. Once you have logged into Doku UI, Go to [API Keys page](http://127.0.0.1:3000/api-keys) and Create an API Key. Copy the generated API Key.- <Tip>Alternatively, you can use the HTTP API to create your Doku API Key. For further details, take a look at the [API Reference](/latest/api-reference/endpoint/api-keys/create) section.</Tip>+ <Tip>Alternatively, you can use the HTTP API to create your Doku API Key. For further details, take a look at the [API Reference](/0.1/api-reference/endpoint/api-keys/create) section.</Tip></Step><Step title="Instrument your Application">Choose the appropriate SDK for your LLM application's programming language and follow the steps to integrate monitoring with just **two lines of code**.diff --git a/docs/latest/connections/datadog.mdx b/docs/latest/connections/datadog.mdxindex b8120776..a3d67e73 100644--- a/docs/latest/connections/datadog.mdx+++ b/docs/latest/connections/datadog.mdx@@ -1,6 +1,6 @@---title: 'DataDog'-description: 'Connect Doku to DataDog'+description: 'LLM Observability with DataDog and Doku'---<Frame>@@ -865,3 +865,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/dynatrace.mdx b/docs/latest/connections/dynatrace.mdxindex 3ac80cef..c232c04a 100644--- a/docs/latest/connections/dynatrace.mdx+++ b/docs/latest/connections/dynatrace.mdx@@ -1,6 +1,6 @@---title: 'Dynatrace'-description: 'Connect Doku to Dynatrace'+description: 'LLM Observability with Dynatrace and Doku'---<Frame>@@ -1759,4 +1759,15 @@ curl --request POST \}}```-</Accordion>\ No newline at end of file+</Accordion>++---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/grafanacloud.mdx b/docs/latest/connections/grafanacloud.mdxindex 1355c402..c95403b9 100644--- a/docs/latest/connections/grafanacloud.mdx+++ b/docs/latest/connections/grafanacloud.mdx@@ -1,6 +1,6 @@---title: 'Grafana Cloud'-description: 'Connect Doku to Grafana Cloud'+description: 'LLM Observability with Grafana Cloud and Doku'---<Frame>@@ -2353,3 +2353,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/grafanaoss.mdx b/docs/latest/connections/grafanaoss.mdxindex 1d607abc..5199d744 100644--- a/docs/latest/connections/grafanaoss.mdx+++ b/docs/latest/connections/grafanaoss.mdx@@ -1,6 +1,6 @@---title: 'Grafana OSS'-description: 'Connect Doku to Grafana OSS'+description: 'LLM Observability with Grafana and Doku'---<Frame>@@ -1933,3 +1933,13 @@ Grafana will attempt to connect to the database using the provided settings. If```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/intro.mdx b/docs/latest/connections/intro.mdxindex 4b269062..36b9d265 100644--- a/docs/latest/connections/intro.mdx+++ b/docs/latest/connections/intro.mdx@@ -28,7 +28,7 @@ Below is a list of observability platforms that work seamlessly with Doku:<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>Integrate your LLM Provider with Doku</Card>-<Card title="API Refernce" href="/latest/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/new-relic.mdx b/docs/latest/connections/new-relic.mdxindex b531f378..982b53af 100644--- a/docs/latest/connections/new-relic.mdx+++ b/docs/latest/connections/new-relic.mdx@@ -1,6 +1,6 @@---title: 'New Relic'-description: 'Connect Doku to New Relic'+description: 'LLM Observability with New Relic and Doku'---<Frame>@@ -577,3 +577,13 @@ curl --request POST \```</Accordion>+---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/connections/signoz.mdx b/docs/latest/connections/signoz.mdxindex e991535b..a10a1b7f 100644--- a/docs/latest/connections/signoz.mdx+++ b/docs/latest/connections/signoz.mdx@@ -1,6 +1,6 @@---title: 'SigNoz'-description: 'Connect Doku to SigNoz'+description: 'LLM Observability with SigNoz and Doku'---<Frame>@@ -1466,4 +1466,15 @@ curl --request POST \]}```-</Accordion>\ No newline at end of file+</Accordion>++---++<CardGroup cols={2}>+<Card title="Integrations" href="/latest/integrations/introduction" icon='circle-nodes'>+Integrate your LLM Provider with Doku+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/installation.mdx b/docs/latest/installation.mdxindex a072ec88..65b701de 100644--- a/docs/latest/installation.mdx+++ b/docs/latest/installation.mdx@@ -1,6 +1,6 @@----title: 'Install Doku'-description: 'Deploy Doku in your preferred environment'+title: 'Installation'+description: 'Self-host Doku in your preferred environment'icon: 'circle-down'---@@ -37,7 +37,7 @@ Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://githu</Step><Step title="Installing the Helm Chart">```shell shell- helm install doku dokulabs/doku+ helm install doku dokulabs/doku --version="0.1.1"```</Step></Steps>@@ -65,7 +65,7 @@ For a quick and straightforward setup, Docker Compose can be used to deploy Dokurestart: alwaysdoku-ingester:- image: ghcr.io/dokulabs/doku-ingester:latest+ image: ghcr.io/dokulabs/doku-ingester:0.1.1container_name: doku-ingesterenvironment:DOKU_DB_HOST: clickhouse@@ -80,7 +80,7 @@ For a quick and straightforward setup, Docker Compose can be used to deploy Dokurestart: alwaysdoku-client:- image: ghcr.io/dokulabs/doku-client:latest+ image: ghcr.io/dokulabs/doku-client:0.1.1container_name: doku-clientenvironment:INIT_DB_HOST: clickhousediff --git a/docs/latest/integrations/anthropic/examples/messages.mdx b/docs/latest/integrations/anthropic/examples/messages.mdxindex 780cc26f..24754e12 100644--- a/docs/latest/integrations/anthropic/examples/messages.mdx+++ b/docs/latest/integrations/anthropic/examples/messages.mdx@@ -1,9 +1,8 @@---title: 'Messages'-description: 'Monitor Anthropic Messages API Usage'+description: 'Monitor Anthropic `messages` API usage for cost, performance & user interactions'----## Completions<Tabs><Tab title="Python">@@ -14,7 +13,6 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = Anthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)@@ -22,13 +20,7 @@ description: 'Monitor Anthropic Messages API Usage'dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")message = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{ "role": "user", "content": "Hello, Explain LLM Monitoring in one sentence"}],model="claude-3-opus-20240229",)print(message.content)@@ -38,7 +30,6 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = Anthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)@@ -46,13 +37,7 @@ description: 'Monitor Anthropic Messages API Usage'dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")stream = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{"role": "user", "content": "Hello, Explain LLM Monitoring in one sentence"}],model="claude-3-opus-20240229",stream=True,)@@ -69,55 +54,41 @@ description: 'Monitor Anthropic Messages API Usage'import dokumetryclient = AsyncAnthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-async def main() -> None:message = await client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ messages=[{"role": "user","content": "Hello, How to monitor LLM Applications?"}],model="claude-3-opus-20240229",)+ print(message.content)asyncio.run(main())-```+```python streamingimport asynciofrom anthropic import AsyncAnthropicimport dokumetryclient = AsyncAnthropic(- # This is the default and can be omittedapi_key="YOUR_ANTHROPIC_API_KEY",)# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- async def main():- stream = client.messages.create(- max_tokens=1024,- messages=[- {- "role": "user",- "content": "Hello, Claude",- }- ],+ async def main() -> None:+ stream = await client.messages.create(+ messages=[{"role": "user","content": "What metrics to monitor for my LLM Applications?"}],model="claude-3-opus-20240229",stream=True,)- for event in stream:+ async for event in stream:print(event.type)asyncio.run(main())@@ -131,7 +102,7 @@ description: 'Monitor Anthropic Messages API Usage'import DokuMetry from 'dokumetry';const anthropic = new Anthropic({- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+ apiKey: 'my_api_key',});// Pass the above `anthropic` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.@@ -139,8 +110,7 @@ description: 'Monitor Anthropic Messages API Usage'async function main() {const message = await anthropic.messages.create({- max_tokens: 1024,- messages: [{ role: 'user', content: 'Hello, Claude' }],+ messages: [{ role: 'user', content: 'How to monitor my LLM Applications?' }],model: 'claude-3-opus-20240229',});@@ -155,15 +125,14 @@ description: 'Monitor Anthropic Messages API Usage'import DokuMetry from 'dokumetry';const anthropic = new Anthropic({- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]+ apiKey: 'my_api_key',});// Pass the above `anthropic` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const stream = await anthropic.messages.create({- max_tokens: 1024,- messages: [{ role: 'user', content: 'Hello, Claude' }],+ messages: [{ role: 'user', content: 'How to setup LLM Obserability?' }],model: 'claude-3-opus-20240229',stream: true,});diff --git a/docs/latest/integrations/anthropic/introduction.mdx b/docs/latest/integrations/anthropic/introduction.mdxindex 7d209822..894c52ca 100644--- a/docs/latest/integrations/anthropic/introduction.mdx+++ b/docs/latest/integrations/anthropic/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Anth## Get Started-The integration is compatible with Anthropic Python SDK version `>=0.19.0` and Typescript SDK version `>=0.9.0`+The integration is compatible with+- Anthropic Python SDK client `>=0.19.0`+- Anthropic JS/TS SDK client `>=0.9.0`<Tabs><Tab title="Python">```shell- pip install dokumetry+ pip install dokumetry==0.1.1``````python@@ -28,7 +30,7 @@ The integration is compatible with Anthropic Python SDK version `>=0.19.0` and T</Tab><Tab title="Javascript">```shell- npm install dokumetry+ npm install [email protected]``````javascript@@ -85,7 +87,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/latest/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/latest/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/latest/integrations/azure-openai/examples/chat.mdx b/docs/latest/integrations/azure-openai/examples/chat.mdxnew file mode 100644index 00000000..8edbec85--- /dev/null+++ b/docs/latest/integrations/azure-openai/examples/chat.mdx@@ -0,0 +1,437 @@+---+title: 'Chat Completions'+description: 'Monitor Azure OpenAI `chat.completions` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage+ <CodeGroup>+ ```python Default+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ]+ )++ print(completion.choices[0].message)+ ```++ ```python Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream=True+ )++ for chunk in completion:+ print(chunk.choices[0].delta)+ ```++ ```python Functions+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ]+ messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]+ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=messages,+ tools=tools,+ tool_choice="auto"+ )++ print(completion)+ ```++ ```python LogProbs+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ completion = client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ logprobs=True,+ top_logprobs=2+ )++ print(completion.choices[0].message)+ print(completion.choices[0].logprobs)+ ```+ </CodeGroup>++ ### Asynchronous Usage++ <CodeGroup>+ ```python Default+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ chat_completion = await client.chat.completions.create(+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ model=azure_model_deployment,+ )++ asyncio.run(main())+ ```++ ```python Streaming+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main():+ stream = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream=True,+ )+ async for chunk in stream:+ print(chunk.choices[0].delta.content or "", end="")+++ asyncio.run(main())+ ```++ ```python Functions+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ]+ messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]++ async def main() -> None:+ completion = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=messages,+ tools=tools,+ tool_choice="auto"+ )++ asyncio.run(main())+ ```++ ```python LogProbs+ import asyncio+ from openai import AsyncAzureOpenAI+ import dokumetry++ client = AsyncAzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ completion = await client.chat.completions.create(+ model=azure_model_deployment,+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ logprobs=True,+ top_logprobs=2+ )++ asyncio.run(main())+ ```+ </CodeGroup>+ </Tab>+ <Tab title="NodeJS">+ <CodeGroup>+ ```javascript Default+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ model: azureModelDeployment,+ });++ console.log(completion.choices[0]);+ }++ main();+ ```++ ```javascript Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ model: azureModelDeployment,+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],+ stream: true,+ });++ for await (const chunk of completion) {+ console.log(chunk.choices[0].delta.content);+ }+ }++ main();+ ```++ ```javascript Functions+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];+ const tools = [+ {+ "type": "function",+ "function": {+ "name": "get_current_weather",+ "description": "Get the current weather in a given location",+ "parameters": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "The city and state, e.g. San Francisco, CA",+ },+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},+ },+ "required": ["location"],+ },+ }+ }+ ];++ const response = await client.chat.completions.create({+ model: azureModelDeployment,+ messages: messages,+ tools: tools,+ tool_choice: "auto",+ });++ console.log(response);+ }++ main();+ ```++ ```javascript LogProbs+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const completion = await client.chat.completions.create({+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my Azure OpenAI based LLM Applications?"}+ ],+ model: azureModelDeployment,+ logprobs: true,+ top_logprobs: 2,+ });++ console.log(completion.choices[0]);+ }++ main();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/azure-openai/examples/completions.mdx b/docs/latest/integrations/azure-openai/examples/completions.mdxnew file mode 100644index 00000000..313a3a23--- /dev/null+++ b/docs/latest/integrations/azure-openai/examples/completions.mdx@@ -0,0 +1,118 @@+---+title: 'Completions'+description: 'Monitor Azure OpenAI `completions` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">+ <CodeGroup>+ ```python No Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = client.completions.create(+ model=azure_model_deployment,+ prompt="What is LLM Observablity?",+ )++ print(respomse.choices[0].text)+ ```++ ```python Streaming+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = client.completions.create(+ model=azure_model_deployment,+ prompt="How to monitor LLM Applications?",+ stream=True+ )++ for chunk in respomse:+ print(chunk.choices[0].text)+ ```+ </CodeGroup>+ </Tab>+ <Tab title="NodeJS">+ <CodeGroup>+ ```javascript No Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await client.completions.create({+ model: azureModelDeployment,+ prompt: "How to monitor LLM Applications?",+ });++ console.log(response);+ }+ main();+ ```++ ```javascript Streaming+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ // Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await client.completions.create({+ model: azureModelDeployment,+ prompt: "How to monitor LLM Applications?",+ stream: true,+ });++ for await (const chunk of response) {+ console.log(chunk.choices[0].text)+ }+ }+ main();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/azure-openai/examples/embeddings.mdx b/docs/latest/integrations/azure-openai/examples/embeddings.mdxnew file mode 100644index 00000000..c218f846--- /dev/null+++ b/docs/latest/integrations/azure-openai/examples/embeddings.mdx@@ -0,0 +1,61 @@+---+title: 'Embeddings'+description: 'Monitor OpenAI Embeddings API usage'+---++## Create Embeddings+<Tabs>+ <Tab title="Python">+ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ client.embeddings.create(+ model=azure_model_deployment,+ input="LLM monitoring",+ encoding_format="float"+ )+ ```+ </Tab>+ <Tab title="javascript">+ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async function main() {+ const embedding = await client.embeddings.create({+ model: azureModelDeployment,+ input: "The quick brown fox jumped over the lazy dog",+ encoding_format: "float",+ });++ console.log(embedding);+ }++ main();+ ```+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/azure-openai/examples/image.mdx b/docs/latest/integrations/azure-openai/examples/image.mdxnew file mode 100644index 00000000..36074dd7--- /dev/null+++ b/docs/latest/integrations/azure-openai/examples/image.mdx@@ -0,0 +1,60 @@+---+title: 'Image'+description: 'Monitor Azure OpenAI `image` API usage for cost, performance & user interactions'+---++## Create Image++<Tabs>+ <Tab title="Python">+ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ azure_model_deployment = "YOUR_AZURE_OPENAI_DEPLOYMENT"++ # Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ image = client.images.generate(+ model=azure_model_deployment,+ prompt="Create a dashboard for LLM Observability data",+ n=1,+ size="1024x1024"+ )++ print(image.data)+ ```+ </Tab>+ <Tab title="Javascript">+ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ const azureModelDeployment = 'YOUR_AZURE_OPENAI_DEPLOYMENT';++ async function main() {+ const image = await client.images.generate({+ model: azureModelDeployment,+ prompt: "Create a dashboard for LLM Observability data"+ });++ console.log(image.data);+ }+ main();+ ```+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/azure-openai/introduction.mdx b/docs/latest/integrations/azure-openai/introduction.mdxnew file mode 100644index 00000000..d6aa989e--- /dev/null+++ b/docs/latest/integrations/azure-openai/introduction.mdx@@ -0,0 +1,102 @@+---+title: 'Azure OpenAI Integration'+sidebarTitle: 'Get Started'+---++DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Azure OpenAI usage data and metrics from your Python/NodeJS code.++## Get Started++The integration is compatible with+- OpenAI Python SDK client `>=1.13.0`+- OpenAI JS/TS SDK client `>=4.28.0`++<Tabs>+ <Tab title="Python">+ ```shell+ pip install dokumetry==0.1.1+ ```++ ```python+ from openai import AzureOpenAI+ import dokumetry++ client = AzureOpenAI(+ api_key = "YOUR_AZURE_OPENAI_API_KEY",+ api_version = "2024-02-01",+ azure_endpoint = "YOUR_AZURE_OPENAI_API_ENDPOINT"+ )++ dokumetry.init(llm = client, doku_url = "YOUR_DOKU_INGESTER_URL", api_key = "YOUR_DOKU_TOKEN")+ ```+ </Tab>+ <Tab title="Javascript">+ ```shell+ npm install [email protected]+ ```++ ```javascript+ import OpenAI from "openai";+ import DokuMetry from 'dokumetry';++ const client = new OpenAI({+ apiKey: "YOUR_AZURE_OPENAI_API_KEY",+ baseURL: `https://YOUR_AZURE_OPENAI_RESOURCE.openai.azure.com/openai/deployments/YOUR_AZURE_OPENAI_DEPLOYMENT`,+ defaultQuery: { 'api-version': "2024-02-01" },+ defaultHeaders: { 'api-key': "YOUR_AZURE_OPENAI_API_KEY" },+ });++ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </Tab>+</Tabs>++## Supported Endpoints++The following Azure OpenAI Endpoints are supported for monitoring with DokuMetry++- [Chat completions](/latest/integrations/azure-openai/examples/chat)+- [Image Create](/latest/integrations/azure-openai/examples/image#create-image)+- [Embeddings](/latest/integrations/azure-openai/examples/embeddings)+- [Completions](/latest/integrations/azure-openai/examples/completions)++## Parameters++<Tabs>+ <Tab title="Python">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Azure OpenAI Object to track | Yes |+ | doku_url | URL of your Doku Ingester | Yes |+ | api_key | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | application_name | Custom application name tag for your metrics | Optional |+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+ <Tab title="NodeJS">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Azure OpenAI Object to track | Yes |+ | dokuUrl | URL of your Doku Ingester | Yes |+ | apiKey | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | applicationName | Custom application name tag for your metrics | Optional |+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+</Tabs>++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.++---++<CardGroup cols={2}>+<Card title="Connections" href="/latest/connections/intro" icon='link'>+Connect to your existing Observablity Platform+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/integrations/cohere/examples/chat.mdx b/docs/latest/integrations/cohere/examples/chat.mdxdeleted file mode 100644index 0b9781d5..00000000--- a/docs/latest/integrations/cohere/examples/chat.mdx+++ /dev/null@@ -1,108 +0,0 @@-----title: 'Chat'-description: 'Monitor Cohere Chat API usage'------## Chat-<Tabs>- <Tab title="Python">- <CodeGroup>- ```python No Streaming- import cohere- import dokumetry-- co = cohere.Client('<<apiKey>>')-- # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-- response = co.chat(- chat_history=[- {"role": "USER", "message": "Who discovered gravity?"},- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}- ],- message="What year was he born?",- # perform web search before answering the question. You can also use your own custom connector.- connectors=[{"id": "web-search"}]- )- print(response)- ```-- ```python Streaming- import cohere- import dokumetry-- co = cohere.Client('<<apiKey>>')-- # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")-- response = co.chat(- chat_history=[- {"role": "USER", "message": "Who discovered gravity?"},- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}- ],- message="What year was he born?",- stream=True,- # perform web search before answering the question. You can also use your own custom connector.- connectors=[{"id": "web-search"}]- )- print(response)- ```- </CodeGroup>- </Tab>- <Tab title="Javascript">- <CodeGroup>- ```javascript No Streaming- import { CohereClient } from "cohere-ai";- import DokuMetry from 'dokumetry';-- const cohere = new CohereClient({- token: "<<apiKey>>",- });-- (async () => {- // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})-- const response = await cohere.chat({- message: 'Say this is a test',- model: 'command',- });-- console.log(response)- })();- ```-- ```javascript Streaming- import { CohereClient } from "cohere-ai";- import DokuMetry from 'dokumetry';-- const cohere = new CohereClient({- token: "<<apiKey>>",- });-- (async () => {- // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})-- const chatStream = await cohere.chatStream({- chatHistory: [- { role: "USER", message: "Who discovered gravity?" },- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }- ],- message: "What year was he born?",- // perform web search before answering the question. You can also use your own custom connector.- connectors: [{ id: "web-search" }],- });-- for await (const message of chatStream) {- if (message.eventType === "text-generation") {- console.log(message);- }- }- })();- ```- </CodeGroup>- </Tab>-</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/cohere/examples/cochat.mdx b/docs/latest/integrations/cohere/examples/cochat.mdxnew file mode 100644index 00000000..fc07c39d--- /dev/null+++ b/docs/latest/integrations/cohere/examples/cochat.mdx@@ -0,0 +1,107 @@+---+title: 'Chat'+description: 'Monitor Cohere `chat` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">+ <CodeGroup>+ ```python No Streaming+ import cohere+ import dokumetry++ co = cohere.Client("YOUR_COHERE_API_KEY")++ # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = co.chat(+ chat_history=[+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message="How to monitor LLM Applications?",+ )+ print(response.text)+ ```++ ```python Streaming+ import cohere+ import dokumetry++ co = cohere.Client("YOUR_COHERE_API_KEY")++ # Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = co.chat(+ chat_history=[+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message="How to monitor LLM Applications?",+ stream=True,+ )+ for text in response:+ if text.eventType === "text-generation":+ print(text)+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Javascript">+ <CodeGroup>+ ```javascript No Streaming+ import { CohereClient } from "cohere-ai";+ import DokuMetry from 'dokumetry';++ const cohere = new CohereClient({+ token: "YOUR_COHERE_API_KEY",+ });++ (async () => {+ // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await cohere.chat({+ chatHistory: [+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message: "How to monitor LLM Applications?",+ model: 'command',+ });++ console.log(response.text)+ })();+ ```++ ```javascript Streaming+ import { CohereClient } from "cohere-ai";+ import DokuMetry from 'dokumetry';++ const cohere = new CohereClient({+ token: "YOUR_COHERE_API_KEY",+ });++ (async () => {+ // Pass the above `cohere` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await cohere.chatStream({+ chatHistory: [+ {"role": "USER", "message": "What is LLM Observability?"},+ {"role": "CHATBOT", "message": "The best tool to monitor LLM Applications is Doku!"}+ ],+ message: "How to monitor LLM Applications?",+ model: 'command',+ });+ for await (const message of response) {+ if (message.eventType === "text-generation") {+ console.log(message);+ }+ }+ })();+ ```+ </CodeGroup>+ </Tab>+</Tabs>\ No newline at end of filediff --git a/docs/latest/integrations/cohere/examples/embed.mdx b/docs/latest/integrations/cohere/examples/embed.mdxindex 38cbaea3..57a3835a 100644--- a/docs/latest/integrations/cohere/examples/embed.mdx+++ b/docs/latest/integrations/cohere/examples/embed.mdx@@ -3,20 +3,19 @@ title: 'Embed'description: 'Monitor Cohere Embed API usage'----## Embed<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")response = co.embed(- texts=['hello', 'goodbye'],+ texts=['LLM', 'Monitoring', 'Observability'],model='embed-english-v3.0',input_type='classification')@@ -29,7 +28,7 @@ description: 'Monitor Cohere Embed API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {@@ -37,7 +36,7 @@ description: 'Monitor Cohere Embed API usage'DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const embed = await cohere.embed({- texts: ["hello", "goodbye"],+ texts: ['LLM', 'Monitoring', 'Observability'],model: "embed-english-v3.0",inputType: "classification",});diff --git a/docs/latest/integrations/cohere/examples/generate.mdx b/docs/latest/integrations/cohere/examples/generate.mdxindex f75589ed..012c50d0 100644--- a/docs/latest/integrations/cohere/examples/generate.mdx+++ b/docs/latest/integrations/cohere/examples/generate.mdx@@ -1,22 +1,21 @@---title: 'Generate'-description: 'Monitor Cohere Generate API usage'+description: 'Monitor Cohere `generate` API usage for cost, performance & user interactions'----## Generate<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")response = co.generate(- prompt='Please explain to me how LLMs work',+ prompt='How to monitor my LLM Applications?',)print(response)```@@ -27,7 +26,7 @@ description: 'Monitor Cohere Generate API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {@@ -35,7 +34,7 @@ description: 'Monitor Cohere Generate API usage'DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})const generate = await cohere.generate({- prompt: "Please explain to me how LLMs work",+ prompt: "What is LLM Monitoring?",});console.log(generate);diff --git a/docs/latest/integrations/cohere/examples/summarize.mdx b/docs/latest/integrations/cohere/examples/summarize.mdxindex cc5edf3d..3715c67b 100644--- a/docs/latest/integrations/cohere/examples/summarize.mdx+++ b/docs/latest/integrations/cohere/examples/summarize.mdx@@ -1,16 +1,15 @@---title: 'Summarize'-description: 'Monitor Cohere Summarize API usage'+description: 'Monitor Cohere `summarize` API usage for cost, performance & user interactions'----## Summarize<Tabs><Tab title="Python">```pythonimport cohereimport dokumetry- co = cohere.Client('<<apiKey>>')+ co = cohere.Client("YOUR_COHERE_API_KEY")# Pass the above `co` object along with your Doku Ingester URL and API key and this will make sure that all Cohere calls are automatically tracked.dokumetry.init(llm=co, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")@@ -50,7 +49,7 @@ description: 'Monitor Cohere Summarize API usage'import DokuMetry from 'dokumetry';const cohere = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});(async () => {diff --git a/docs/latest/integrations/cohere/introduction.mdx b/docs/latest/integrations/cohere/introduction.mdxindex bc5bf873..ddcd8494 100644--- a/docs/latest/integrations/cohere/introduction.mdx+++ b/docs/latest/integrations/cohere/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Cohe## Get Started-The integration is compatible with Cohere Python SDK version `>=5.0.0` and Typescript SDK version `>=7.6.0`+The integration is compatible with+- Cohere Python SDK client `>=5.0.0`+- Cohere JS/TS SDK client `>=7.6.0`<Tabs><Tab title="Python">```shell- pip install dokumetry+ pip install dokumetry==0.1.1``````python@@ -26,7 +28,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Types</Tab><Tab title="Javascript">```shell- npm install dokumetry+ npm install [email protected]``````javascript@@ -34,7 +36,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Typesimport DokuMetry from 'dokumetry';const co = new CohereClient({- token: "<<apiKey>>",+ token: "YOUR_COHERE_API_KEY",});DokuMetry.init({llm: co, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})@@ -45,7 +47,7 @@ The integration is compatible with Cohere Python SDK version `>=5.0.0` and Types## Supported EndpointsThe following Cohere Endpoints are supported for monitoring with DokuMetry-- [Chat](/latest/integrations/cohere/examples/chat)+- [Chat](/latest/integrations/cohere/examples/cochat)- [Generate](/latest/integrations/cohere/examples/generate)- [Summarize](/latest/integrations/cohere/examples/summarize)- [Embed](/latest/integrations/cohere/examples/embed)@@ -86,7 +88,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/latest/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/latest/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/latest/integrations/introduction.mdx b/docs/latest/integrations/introduction.mdxindex 348c1738..b0b77042 100644--- a/docs/latest/integrations/introduction.mdx+++ b/docs/latest/integrations/introduction.mdx@@ -1,12 +1,12 @@---sidebarTitle: 'Introduction'-title: 'Monitor your LLM usage'+title: 'Monitor your LLM Applications'description: 'Monitor LLM Costs, Tokens and Performance along with User Interactions'---Start integrating and monitoring your applications with Doku effortlessly. Choose from a range of providers to **start tracking LLM performance, usage, and costs** without hassle.-<CardGroup cols={3}>+<CardGroup cols={2}><Cardtitle="OpenAI"href="/latest/integrations/openai/introduction"@@ -23,7 +23,7 @@ Start integrating and monitoring your applications with Doku effortlessly. Choostitle="Cohere"href="/latest/integrations/cohere/introduction"icon={- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">+ <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><g><g><g>@@ -48,7 +48,7 @@ Start integrating and monitoring your applications with Doku effortlessly. Choostitle="Anthropic"href="/latest/integrations/anthropic/introduction"icon={- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">+ <svg viewBox="0 0 255 255" xmlns="http://www.w3.org/2000/svg"><path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path><path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path></svg>@@ -56,6 +56,42 @@ Start integrating and monitoring your applications with Doku effortlessly. ChoosiconType="duotone"></Card>+ <Card+ title="Azure OpenAI"+ href="/latest/integrations/azure-openai/introduction"+ icon={+ <svg viewBox="0 0 525 525" xmlns="http://www.w3.org/2000/svg"><g>+ <path d="M52.091 10.225h40.684L50.541 135.361a6.5 6.5 0 01-6.146 4.412H12.732c-3.553 0-6.477-2.923-6.477-6.476 0-.704.115-1.403.34-2.07L45.944 14.638a6.501 6.501 0 016.147-4.415v.002z" transform="translate(2.076 1.626) scale(3.37462)"/><path d="M377.371 319.374H159.644c-5.527 0-10.076 4.549-10.076 10.077 0 2.794 1.164 5.466 3.206 7.37l139.901 130.577a21.986 21.986 0 0015.004 5.91H430.96l-53.589-153.934z"/><path d="M52.091 10.225a6.447 6.447 0 00-6.161 4.498L6.644 131.12a6.457 6.457 0 00-.38 2.185c0 3.548 2.92 6.468 6.469 6.468H45.23a6.95 6.95 0 005.328-4.531l7.834-23.089 27.985 26.102a6.622 6.622 0 004.165 1.518h36.395l-15.962-45.615-46.533.011 28.48-83.944H52.091z" transform="translate(2.076 1.626) scale(3.37462)"/><path d="M104.055 14.631a6.492 6.492 0 00-6.138-4.406H52.575a6.493 6.493 0 016.138 4.406l39.35 116.594c.225.668.34 1.367.34 2.072 0 3.554-2.924 6.478-6.478 6.478h45.344c3.553-.001 6.476-2.925 6.476-6.478 0-.705-.115-1.404-.34-2.072l-39.35-116.594z" transform="translate(2.076 1.626) scale(3.37462)"/></g><defs><linearGradient id="prefix___Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(108.701 26.35 33.911) scale(131.7791)"><stop offset="0"/><stop offset="1"/></linearGradient><linearGradient id="prefix___Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(161.318 33.644 45.587) scale(10.31703)"><stop offset="0"/><stop offset=".07"/><stop offset=".32"/><stop offset=".62"/><stop offset="1"/></linearGradient><linearGradient id="prefix___Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(69.426 25.69 62.036) scale(131.9816)"><stop offset="0"/><stop offset="1"/></linearGradient></defs>+ </svg>+ }+ iconType="duotone"+ >+ </Card>+ <Card+ title="Mistral"+ href="/latest/integrations/mistral/introduction"+ icon={+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 355 355">+ <path d="M0 0 C27.39 0 54.78 0 83 0 C83 17.82 83 35.64 83 54 C100.82 54 118.64 54 137 54 C137 71.82 137 89.64 137 108 C145.58 108 154.16 108 163 108 C163 90.18 163 72.36 163 54 C180.82 54 198.64 54 217 54 C217 36.18 217 18.36 217 0 C244.39 0 271.78 0 300 0 C300 90.09 300 180.18 300 273 C272.61 273 245.22 273 217 273 C217 237.36 217 201.72 217 165 C208.75 165 200.5 165 192 165 C192 182.82 192 200.64 192 219 C164.28 219 136.56 219 108 219 C108 201.18 108 183.36 108 165 C99.75 165 91.5 165 83 165 C83 200.64 83 236.28 83 273 C55.61 273 28.22 273 0 273 C0 182.91 0 92.82 0 0 Z "/>+ <path d="M0 0 C27.39 0 54.78 0 83 0 C83 35.97 83 71.94 83 109 C37.79 109 -7.42 109 -54 109 C-54 90.85 -54 72.7 -54 54 C-36.18 54 -18.36 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ <path d="M0 0 C18.48 0 36.96 0 56 0 C56 17.82 56 35.64 56 54 C73.82 54 91.64 54 110 54 C110 72.15 110 90.3 110 109 C73.7 109 37.4 109 0 109 C0 73.03 0 37.06 0 0 Z "/>+ <path d="M0 0 C8.91 0 17.82 0 27 0 C27 90.09 27 180.18 27 273 C18.09 273 9.18 273 0 273 C0 182.91 0 92.82 0 0 Z " transform="translate(0,0)"/>+ <path d="M0 0 C9.57 0 19.14 0 29 0 C29 17.82 29 35.64 29 54 C46.82 54 64.64 54 83 54 C83 72.15 83 90.3 83 109 C55.61 109 28.22 109 0 109 C0 73.03 0 37.06 0 0 Z "/>+ <path d="M0 0 C1.01154144 -0.00311188 2.02308289 -0.00622375 3.0652771 -0.00942993 C4.7290892 -0.00645401 4.7290892 -0.00645401 6.42651367 -0.00341797 C7.57181549 -0.00473724 8.71711731 -0.00605652 9.89712524 -0.00741577 C13.62960487 -0.0093378 17.3620104 -0.00299456 21.09448242 0.00439453 C22.34907257 0.00528076 23.60366272 0.00616699 24.89627075 0.00708008 C42.72160294 0.02199104 60.47499934 0.28646042 78.28198242 1.12939453 C78.28198242 19.27939453 78.28198242 37.42939453 78.28198242 56.12939453 C50.56198242 56.12939453 22.84198242 56.12939453 -5.71801758 56.12939453 C-5.73864258 47.07501953 -5.75926758 38.02064453 -5.78051758 28.69189453 C-5.79417358 24.39847046 -5.79417358 24.39847046 -5.80810547 20.01831055 C-5.8110244 17.76497444 -5.81357301 15.5116378 -5.81567383 13.25830078 C-5.82078979 12.07586792 -5.82590576 10.89343506 -5.83117676 9.6751709 C-5.83129761 8.55864136 -5.83141846 7.44211182 -5.83154297 6.29174805 C-5.83376358 5.31689957 -5.83598419 4.34205109 -5.83827209 3.33766174 C-5.61659259 -0.73310076 -3.57396693 0.00319344 0 0 Z "/>+ <path d="M0 0 C0.33 0 0.66 0 1 0 C1 35.97 1 71.94 1 109 C19.15 109 37.3 109 56 109 C56 127.15 56 145.3 56 164 C37.52 164 19.04 164 0 164 C0 109.88 0 55.76 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 35.97 28 71.94 28 109 C18.76 109 9.52 109 0 109 C0 73.03 0 37.06 0 0 Z " transform="translate(217,164)"/>+ <path d="M0 0 C18.15 0 36.3 0 55 0 C55.020625 8.889375 55.04125 17.77875 55.0625 26.9375 C55.071604 29.74757568 55.08070801 32.55765137 55.09008789 35.45288086 C55.09300683 37.66520134 55.09555544 39.87752235 55.09765625 42.08984375 C55.10277222 43.25068481 55.10788818 44.41152588 55.11315918 45.60754395 C55.11334045 47.25188416 55.11334045 47.25188416 55.11352539 48.92944336 C55.115746 49.88652695 55.11796661 50.84361053 55.12025452 51.82969666 C55 54 55 54 54 55 C52.31198015 55.09353163 50.62004793 55.11744791 48.92944336 55.11352539 C47.83321655 55.11340454 46.73698975 55.11328369 45.60754395 55.11315918 C44.44670288 55.10804321 43.28586182 55.10292725 42.08984375 55.09765625 C41.02930786 55.09664917 39.96877197 55.09564209 38.87609863 55.09460449 C34.89655483 55.08935387 30.91702638 55.07539276 26.9375 55.0625 C18.048125 55.041875 9.15875 55.02125 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C7.33845237 -0.02590394 14.6768925 -0.04309155 22.01538086 -0.05493164 C24.49845825 -0.05988087 26.98153287 -0.0666419 29.46459961 -0.07543945 C47.00774093 -0.13592078 64.47120007 0.2552166 82 1 C82 18.82 82 36.64 82 55 C64.18 55 46.36 55 28 55 C28 37.18 28 19.36 28 1 C18.76 1 9.52 1 0 1 C0 0.67 0 0.34 0 0 Z "/>+ <path d="M0 0 C18.15 0 36.3 0 55 0 C55 17.82 55 35.64 55 54 C36.85 54 18.7 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ <path d="M0 0 C17.82 0 35.64 0 54 0 C54 18.15 54 36.3 54 55 C36.18 55 18.36 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 18.15 28 36.3 28 55 C18.76 55 9.52 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 18.15 28 36.3 28 55 C18.76 55 9.52 55 0 55 C0 36.85 0 18.7 0 0 Z "/>+ <path d="M0 0 C9.24 0 18.48 0 28 0 C28 17.82 28 35.64 28 54 C18.76 54 9.52 54 0 54 C0 36.18 0 18.36 0 0 Z "/>+ </svg>+ }+ iconType="duotone"+ >+ </Card></CardGroup>---diff --git a/docs/latest/integrations/mistral/examples/embedding.mdx b/docs/latest/integrations/mistral/examples/embedding.mdxnew file mode 100644index 00000000..a9a3dc71--- /dev/null+++ b/docs/latest/integrations/mistral/examples/embedding.mdx@@ -0,0 +1,79 @@+---+title: 'Embedding'+description: 'Monitor Mistral Embedding API Usage'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage++ ```python default+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.embeddings(+ model="mistral-embed",+ input=["Monitor LLM Applications"]+ )+ print(response)+ ```++ ### Asynchronous usage+ ```python default+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ mistral.embeddings(+ model="mistral-embed",+ input=["Monitor LLM Applications"]+ )++ print(response)++ asyncio.run(main())+ ```+ </Tab>+ <Tab title="Javascript">++ ```javascript default+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const input = [];+ for (let i = 0; i < 1; i++) {+ input.push('LLM Monitoring');+ }+ const embeddingsBatchResponse = await mistral.embeddings({+ model: 'mistral-embed',+ input: input,+ });+ }++ main();+ ```+ </Tab>+</Tabs>+diff --git a/docs/latest/integrations/mistral/examples/mistral-chat.mdx b/docs/latest/integrations/mistral/examples/mistral-chat.mdxnew file mode 100644index 00000000..cde33eaf--- /dev/null+++ b/docs/latest/integrations/mistral/examples/mistral-chat.mdx@@ -0,0 +1,142 @@+---+title: 'Chat'+description: 'Monitor Mistral `chat` API usage for cost, performance & user interactions'+---++<Tabs>+ <Tab title="Python">++ ### Synchronous Usage+ <CodeGroup>+ ```python default+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.chat(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ print(response)+ ```++ ```python streaming+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ response = mistral.chat_stream(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ for chunk in response:+ print(chunk)+ ```+ </CodeGroup>++ ### Asynchronous usage+ <CodeGroup>+ ```python default+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ response = mistral.chat(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ print(message)++ asyncio.run(main())+ ```++ ```python streaming+ import asyncio+ from mistralai.client import AsyncMistralClient+ import dokumetry++ mistral = AsyncMistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ # Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")++ async def main() -> None:+ response = mistral.chat_stream(+ model="mistral-small-latest",+ messages=[ChatMessage(role="user", content="Guide to Monitor my LLM Applications")],+ )+ for chunk in response:+ print(chunk)++ asyncio.run(main())+ ```+ </CodeGroup>+ </Tab>+ <Tab title="Javascript">+ <CodeGroup>++ ```javascript default+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ async function main() {+ const response = await mistral.chat({+ model: 'mistral-small-latest',+ messages: [{role: 'user', content: 'What is LLM Observability?'}],+ });++ console.log(response);+ }++ main();+ ```++ ```javascript streaming+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ // Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.+ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})++ const response = await mistral.chatStream({+ model: 'mistral-small-latest',+ messages: [{role: 'user', content: 'What is LLM Observability?'}],+ });++ for await (const message of response) {+ console.log(message)+ }+ ```+ </CodeGroup>+ </Tab>+</Tabs>+diff --git a/docs/latest/integrations/mistral/introduction.mdx b/docs/latest/integrations/mistral/introduction.mdxnew file mode 100644index 00000000..7f772eb5--- /dev/null+++ b/docs/latest/integrations/mistral/introduction.mdx@@ -0,0 +1,92 @@+---+title: 'Mistral Integration'+sidebarTitle: 'Get Started'+---++DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Mistral usage data and metrics from your Python/NodeJS code.++## Get Started++The integration is compatible with+- Mistral Python SDK client `>=0.1.0`+- Mistral JS/TS SDK client `>=0.1.0`++<Tabs>+ <Tab title="Python">+ ```shell+ pip install dokumetry==0.1.1+ ```++ ```python+ from mistralai.client import MistralClient+ import dokumetry++ mistral = MistralClient(+ api_key="YOUR_MISTRAL_API_KEY"+ )++ dokumetry.init(llm = Mistral, doku_url = "YOUR_DOKU_INGESTER_URL", api_key = "YOUR_DOKU_TOKEN")+ ```+ </Tab>+ <Tab title="Javascript">+ ```shell+ npm install [email protected]+ ```++ ```javascript+ import MistralClient from '@mistralai/mistralai';+ import DokuMetry from 'dokumetry';++ const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");++ DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})+ ```+ </Tab>+</Tabs>++## Supported Endpoints++The following Mistral Endpoints are supported for monitoring with DokuMetry++- [chat](/latest/integrations/mistral/examples/mistral-chat)+- [embedding](/latest/integrations/mistral/examples/embedding)++## Parameters+<Tabs>+ <Tab title="Python">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Mistral Object to track | Yes |+ | doku_url | URL of your Doku Ingester | Yes |+ | api_key | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | application_name | Custom application name tag for your metrics | Optional |+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+ <Tab title="NodeJS">+ | Parameter | Description | Required |+ |-------------------|-----------------------------------------------------------|---------------|+ | llm | Mistral Object to track | Yes |+ | dokuUrl | URL of your Doku Ingester | Yes |+ | apiKey | Your Doku API key | Yes |+ | environment | Custom environment tag to include in your metrics | Optional |+ | applicationName | Custom application name tag for your metrics | Optional |+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |+ </Tab>+</Tabs>++## Advanced Usage+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.++To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.++---++<CardGroup cols={2}>+<Card title="Connections" href="/latest/connections/intro" icon='link'>+Connect to your existing Observablity Platform+</Card>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>+OpenAPI specification for API Endpoints in Doku+</Card>+</CardGroup>\ No newline at end of filediff --git a/docs/latest/integrations/openai/examples/audio.mdx b/docs/latest/integrations/openai/examples/audio.mdxindex d6b7ffac..7a1108c2 100644--- a/docs/latest/integrations/openai/examples/audio.mdx+++ b/docs/latest/integrations/openai/examples/audio.mdx@@ -21,9 +21,9 @@ description: 'Monitor OpenAI Audio API usage'speech_file_path = Path(__file__).parent / "speech.mp3"response = client.audio.speech.create(- model="tts-1",- voice="alloy",- input="The quick brown fox jumped over the lazy dog."+ model= "tts-1",+ voice= "alloy",+ input= "The quick brown fox jumped over the lazy dog.")response.stream_to_file(speech_file_path)```diff --git a/docs/latest/integrations/openai/examples/chat.mdx b/docs/latest/integrations/openai/examples/chatCompletions.mdxsimilarity index 87%rename from docs/latest/integrations/openai/examples/chat.mdxrename to docs/latest/integrations/openai/examples/chatCompletions.mdxindex 4894c512..f4770f05 100644--- a/docs/latest/integrations/openai/examples/chat.mdx+++ b/docs/latest/integrations/openai/examples/chatCompletions.mdx@@ -1,9 +1,8 @@---title: 'Chat Completions'-description: 'Monitor OpenAI Chat Completions API usage'+description: 'Monitor OpenAI `chat.completions` API usage for cost, performance & user interactions'----<Tabs><Tab title="Python">@@ -23,8 +22,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}])@@ -76,8 +75,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],stream=True)@@ -142,7 +141,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],logprobs=True,top_logprobs=2@@ -171,10 +171,8 @@ description: 'Monitor OpenAI Chat Completions API usage'async def main() -> None:chat_completion = await client.chat.completions.create(messages=[- {- "role": "user",- "content": "Say this is a test",- }+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],model="gpt-3.5-turbo",)@@ -230,7 +228,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async def main():stream = await client.chat.completions.create(model="gpt-4",- messages=[{"role": "user", "content": "Say this is a test"}],+ messages=[+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],stream=True,)async for chunk in stream:@@ -301,7 +302,8 @@ description: 'Monitor OpenAI Chat Completions API usage'completion = await client.chat.completions.create(model="gpt-3.5-turbo",messages=[- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],logprobs=True,top_logprobs=2@@ -324,7 +326,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async function main() {const completion = await openai.chat.completions.create({- messages: [{ role: "system", content: "You are a helpful assistant." }],+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],model: "gpt-3.5-turbo",});@@ -378,8 +383,8 @@ description: 'Monitor OpenAI Chat Completions API usage'const completion = await openai.chat.completions.create({model: "gpt-3.5-turbo",messages: [- {"role": "system", "content": "You are a helpful assistant."},- {"role": "user", "content": "Hello!"}+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}],stream: true,});@@ -448,7 +453,10 @@ description: 'Monitor OpenAI Chat Completions API usage'async function main() {const completion = await openai.chat.completions.create({- messages: [{ role: "user", content: "Hello!" }],+ messages: [+ {"role": "system", "content": "You are a expert at monitoring LLM Applications"},+ {"role": "user", "content": "Hello! How do I monitor my OpenAI based LLM Applications?"}+ ],model: "gpt-3.5-turbo",logprobs: true,top_logprobs: 2,diff --git a/docs/latest/integrations/openai/examples/completions.mdx b/docs/latest/integrations/openai/examples/completions.mdxindex 89f9f54c..07a00c0d 100644--- a/docs/latest/integrations/openai/examples/completions.mdx+++ b/docs/latest/integrations/openai/examples/completions.mdx@@ -1,6 +1,6 @@---title: 'Completions'-description: 'Monitor OpenAI Completions API Usage'+description: 'Monitor OpenAI `completions` API usage for cost, performance & user interactions'---<Tabs>@@ -17,12 +17,12 @@ description: 'Monitor OpenAI Completions API Usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- client.completions.create(+ response = client.completions.create(model="gpt-3.5-turbo-instruct",- prompt="Say this is a test",- max_tokens=7,- temperature=0+ prompt="What is LLM Observablity?",)++ print(respomse.choices[0].text)``````python Streaming@@ -36,15 +36,14 @@ description: 'Monitor OpenAI Completions API Usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- for chunk in client.completions.create(+ response = client.completions.create(model="gpt-3.5-turbo-instruct",- prompt="Say this is a test",- max_tokens=7,- temperature=0,+ prompt="How to monitor LLM Applications?",stream=True- ):+ )- print(chunk.choices[0].text)+ for chunk in respomse:+ print(chunk.choices[0].text)```</CodeGroup></Tab>@@ -60,14 +59,12 @@ description: 'Monitor OpenAI Completions API Usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const completion = await openai.completions.create({+ const response = await openai.completions.create({model: "gpt-3.5-turbo-instruct",- prompt: "Say this is a test.",- max_tokens: 7,- temperature: 0,+ prompt: "How to monitor LLM Applications?",});- console.log(completion);+ console.log(response);}main();```@@ -82,13 +79,13 @@ description: 'Monitor OpenAI Completions API Usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const stream = await openai.completions.create({+ const response = await openai.completions.create({model: "gpt-3.5-turbo-instruct",- prompt: "Say this is a test.",+ prompt: "How to monitor LLM Applications?",stream: true,});- for await (const chunk of stream) {+ for await (const chunk of response) {console.log(chunk.choices[0].text)}}diff --git a/docs/latest/integrations/openai/examples/image.mdx b/docs/latest/integrations/openai/examples/image.mdxindex e92e2b3c..f327ebf1 100644--- a/docs/latest/integrations/openai/examples/image.mdx+++ b/docs/latest/integrations/openai/examples/image.mdx@@ -1,6 +1,6 @@---title: 'Image'-description: 'Monitor OpenAI Image API usage'+description: 'Monitor OpenAI `image` API usage for cost, performance & user interactions'---## Create Image@@ -18,12 +18,14 @@ description: 'Monitor OpenAI Image API usage'# Pass the above `client` object along with your Doku Ingester URL and API key and this will make sure that all OpenAI calls are automatically tracked.dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")- client.images.generate(+ image = client.images.generate(model="dall-e-3",- prompt="A cute baby sea otter",+ prompt="Create a dashboard for LLM Observability data",n=1,size="1024x1024")++ print(image.data)```</Tab><Tab title="Javascript">@@ -37,7 +39,7 @@ description: 'Monitor OpenAI Image API usage'DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})async function main() {- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });+ const image = await openai.images.generate({ model: "dall-e-3", prompt: "Create a dashboard for LLM Observability data" });console.log(image.data);}diff --git a/docs/latest/integrations/openai/introduction.mdx b/docs/latest/integrations/openai/introduction.mdxindex 08e33ab8..041ad753 100644--- a/docs/latest/integrations/openai/introduction.mdx+++ b/docs/latest/integrations/openai/introduction.mdx@@ -7,12 +7,14 @@ DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Open## Get Started-The integration is compatible with OpenAI Python SDK version `>=1.13.0` and NodeJS SDK `>=4.28.0`+The integration is compatible with+- OpenAI Python SDK client `>=1.13.0`+- OpenAI JS/TS SDK client `>=4.28.0`<Tabs><Tab title="Python">```shell- pip install dokumetry+ pip install dokumetry==0.1.1``````python@@ -26,7 +28,7 @@ The integration is compatible with OpenAI Python SDK version `>=1.13.0` and Node</Tab><Tab title="Javascript">```shell- npm install dokumetry+ npm install [email protected]``````javascript@@ -44,7 +46,7 @@ The integration is compatible with OpenAI Python SDK version `>=1.13.0` and NodeThe following OpenAI Endpoints are supported for monitoring with DokuMetry-- [Chat completions](/latest/integrations/openai/examples/chat)+- [Chat completions](/latest/integrations/openai/examples/chatCompletions)- [Image Create](/latest/integrations/openai/examples/image#create-image) and [Image Variations](/latest/integrations/openai/examples/image#create-image-variation)- [Audio Speech Create](/latest/integrations/openai/examples/audio)- [Embeddings](/latest/integrations/openai/examples/embeddings)@@ -87,7 +89,7 @@ To filter your LLM Usage according application or the environment, set the Appli<Card title="Connections" href="/latest/connections/intro" icon='link'>Connect to your existing Observablity Platform</Card>-<Card title="API Refernce" href="/latest/api-reference/introduction" icon='code'>+<Card title="API Reference" href="/latest/api-reference/introduction" icon='code'>OpenAPI specification for API Endpoints in Doku</Card></CardGroup>\ No newline at end of filediff --git a/docs/latest/introduction.mdx b/docs/latest/introduction.mdxindex 3b60af97..5a46c275 100644--- a/docs/latest/introduction.mdx+++ b/docs/latest/introduction.mdx@@ -54,7 +54,6 @@ With your LLM monitoring data processed and securely stored, you can now leverag</Frame>For those with a preferred observability platform, you can also integrate and visualize this data elsewhere with ease. This flexibility ensures optimal monitoring workflow integration, regardless of your platform choice. For more details on how to set up these connections, check out the [Connections](/latest/connections/intro) guide.-## Getting StartedSelect from the following guides to learn more about how to use Doku:diff --git a/docs/latest/quickstart.mdx b/docs/latest/quickstart.mdxindex 7d57b9c8..f0363d90 100644--- a/docs/latest/quickstart.mdx+++ b/docs/latest/quickstart.mdx@@ -28,7 +28,7 @@ This guide will walk you through setting up monitoring for your LLM Applicationrestart: alwaysdoku-ingester:- image: ghcr.io/dokulabs/doku-ingester:latest+ image: ghcr.io/dokulabs/doku-ingester:0.1.1container_name: doku-ingesterenvironment:DOKU_DB_HOST: clickhouse@@ -43,7 +43,7 @@ This guide will walk you through setting up monitoring for your LLM Applicationrestart: alwaysdoku-client:- image: ghcr.io/dokulabs/doku-client:latest+ image: ghcr.io/dokulabs/doku-client:0.1.1container_name: doku-clientenvironment:INIT_DB_HOST: clickhousediff --git a/docs/mint.json b/docs/mint.jsonindex 75267c4e..149b9d52 100644--- a/docs/mint.json+++ b/docs/mint.json@@ -1,6 +1,6 @@{"$schema": "https://mintlify.com/schema.json",- "versions": ["latest","0.1"],+ "versions": ["latest", "0.1"],"name": "Doku","logo": {"dark": "https://github.com/dokulabs/.github/blob/main/profile/assets/dark-bg-with-text-logo.jpg?raw=true",@@ -16,12 +16,11 @@"to": "#FFA500"}},- "topbarLinks": [- {- "name": "Contact Us",- "url": "mailto:[email protected]"- }- ],+ "topbarCtaButton":+ {+ "name": "Website",+ "url": "https://dokulabs.com/"+ },"modeToggle": {"default": "light"},@@ -66,7 +65,7 @@"group": "Examples","version": "latest","pages": [- "latest/integrations/openai/examples/chat",+ "latest/integrations/openai/examples/chatCompletions","latest/integrations/openai/examples/image","latest/integrations/openai/examples/embeddings","latest/integrations/openai/examples/audio",@@ -85,7 +84,7 @@"group": "Examples","version": "latest","pages": [- "latest/integrations/cohere/examples/chat",+ "latest/integrations/cohere/examples/cochat","latest/integrations/cohere/examples/generate","latest/integrations/cohere/examples/summarize","latest/integrations/cohere/examples/embed"@@ -106,6 +105,38 @@]}]+ },+ {+ "group": "Mistral",+ "version": "latest",+ "pages": [+ "latest/integrations/mistral/introduction",+ {+ "group": "Examples",+ "version": "latest",+ "pages": [+ "latest/integrations/mistral/examples/mistral-chat",+ "latest/integrations/mistral/examples/embedding"+ ]+ }+ ]+ },+ {+ "group": "Azure OpenAI",+ "version": "latest",+ "pages": [+ "latest/integrations/azure-openai/introduction",+ {+ "group": "Examples",+ "version": "latest",+ "pages": [+ "latest/integrations/azure-openai/examples/chat",+ "latest/integrations/azure-openai/examples/image",+ "latest/integrations/azure-openai/examples/embeddings",+ "latest/integrations/azure-openai/examples/completions"+ ]+ }+ ]}]},@@ -172,7 +203,7 @@"group": "Examples","version": "0.1","pages": [- "0.1/integrations/openai/examples/chat",+ "0.1/integrations/openai/examples/chatCompletions","0.1/integrations/openai/examples/image","0.1/integrations/openai/examples/embeddings","0.1/integrations/openai/examples/audio",@@ -191,7 +222,7 @@"group": "Examples","version": "0.1","pages": [- "0.1/integrations/cohere/examples/chat",+ "0.1/integrations/cohere/examples/cochat","0.1/integrations/cohere/examples/generate","0.1/integrations/cohere/examples/summarize","0.1/integrations/cohere/examples/embed"@@ -212,6 +243,38 @@]}]+ },+ {+ "group": "Mistral",+ "version": "0.1",+ "pages": [+ "0.1/integrations/mistral/introduction",+ {+ "group": "Examples",+ "version": "0.1",+ "pages": [+ "0.1/integrations/mistral/examples/mistral-chat",+ "0.1/integrations/mistral/examples/embedding"+ ]+ }+ ]+ },+ {+ "group": "Azure OpenAI",+ "version": "0.1",+ "pages": [+ "0.1/integrations/azure-openai/introduction",+ {+ "group": "Examples",+ "version": "0.1",+ "pages": [+ "0.1/integrations/azure-openai/examples/chat",+ "0.1/integrations/azure-openai/examples/image",+ "0.1/integrations/azure-openai/examples/embeddings",+ "0.1/integrations/azure-openai/examples/completions"+ ]+ }+ ]}]},diff --git a/src/client/src/lib/doku/category.ts b/src/client/src/lib/doku/category.tsindex bda2f41f..54758bba 100644--- a/src/client/src/lib/doku/category.ts+++ b/src/client/src/lib/doku/category.ts@@ -13,12 +13,11 @@ FROM(SELECTCASE- WHEN endpoint LIKE 'openai.chat%' THEN '${GENERATION_CATEGORIZATION.chat}'- WHEN endpoint LIKE 'openai.completions%' THEN '${GENERATION_CATEGORIZATION.chat}'+ WHEN endpoint LIKE '%chat%' THEN '${GENERATION_CATEGORIZATION.chat}'+ WHEN endpoint LIKE '%completions%' THEN '${GENERATION_CATEGORIZATION.chat}'WHEN endpoint LIKE 'anthropic.messages%' THEN '${GENERATION_CATEGORIZATION.chat}'WHEN endpoint LIKE 'cohere.summarize%' THEN '${GENERATION_CATEGORIZATION.chat}'WHEN endpoint LIKE 'cohere.generate%' THEN '${GENERATION_CATEGORIZATION.chat}'- WHEN endpoint LIKE 'cohere.chat%' THEN '${GENERATION_CATEGORIZATION.chat}'WHEN endpoint LIKE '%embed%' THEN '${GENERATION_CATEGORIZATION.embed}'WHEN endpoint LIKE 'openai.images%' THEN '${GENERATION_CATEGORIZATION.image}'WHEN endpoint LIKE 'openai.audio%' THEN '${GENERATION_CATEGORIZATION.audio}'diff --git a/src/ingester/connections/connections.go b/src/ingester/connections/connections.goindex f7c2d468..72df32bd 100644--- a/src/ingester/connections/connections.go+++ b/src/ingester/connections/connections.go@@ -22,13 +22,19 @@ var (endpointTypeMapping = map[string]string{"openai.chat.completions": "Chat","openai.completions": "Chat",+ "azure.chat.completions": "Chat",+ "azure.completions": "Chat","cohere.generate": "Chat","cohere.chat": "Chat","cohere.summarize": "Chat","anthropic.messages": "Chat",+ "mistral.chat": "Chat","openai.embeddings": "Embeddings",+ "azure.embeddings": "Embeddings","cohere.embed": "Embeddings",+ "mistral.embeddings": "Embeddings","openai.images.create": "Image",+ "azure.images.create": "Image","openai.images.create.variations": "Image","openai.audio.speech.create": "Audio","openai.fine_tuning": "FineTuning",diff --git a/src/ingester/connections/datadog.go b/src/ingester/connections/datadog.goindex b316aea1..44917211 100644--- a/src/ingester/connections/datadog.go+++ b/src/ingester/connections/datadog.go@@ -32,7 +32,7 @@ func configureDataDogData(data map[string]interface{}, config ConnectionConfig)call_type = "Unknown"}- if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" {+ if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["finishReason"] == nil {data["finishReason"] = "null"}@@ -103,7 +103,7 @@ func configureDataDogData(data map[string]interface{}, config ConnectionConfig)if err != nil {log.Error().Err(err).Msgf("Error sending Logs to DataDog")}- } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "azure.embeddings" || data["endpoint"] == "mistral.embeddings" {if data["endpoint"] == "openai.embeddings" {metricStrings := []string{@@ -221,7 +221,7 @@ func configureDataDogData(data map[string]interface{}, config ConnectionConfig)if err != nil {log.Error().Err(err).Msgf("Error sending Metrics to DataDog")}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {metricStrings := []string{fmt.Sprintf(`{"metric": "doku.llm.request.duration",diff --git a/src/ingester/connections/dynatrace.go b/src/ingester/connections/dynatrace.goindex 1158ffe8..b93d206a 100644--- a/src/ingester/connections/dynatrace.go+++ b/src/ingester/connections/dynatrace.go@@ -30,7 +30,7 @@ func configureDynatraceData(data map[string]interface{}, config ConnectionConfigcall_type = "Unknown"}- if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" {+ if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["finishReason"] == nil {data["finishReason"] = "null"}@@ -81,7 +81,7 @@ func configureDynatraceData(data map[string]interface{}, config ConnectionConfigif err != nil {log.Error().Err(err).Msgf("Error sending Logs to DataDog")}- } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "mistral.embeddings" || data["endpoint"] == "azure.embeddings" {if data["endpoint"] == "openai.embeddings" {// Building the data string by concatenating sprintf calls for each metricmetrics := fmt.Sprintf(`doku.llm.total.tokens,environment="%v",endpoint="%v",application="%v",source="%v",model="%v",platform="%v",generation="%v",job="doku" %v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], platform, call_type, data["totalTokens"]) + "\n" +@@ -156,7 +156,7 @@ func configureDynatraceData(data map[string]interface{}, config ConnectionConfigif err != nil {log.Error().Err(err).Msgf("Error sending Metrics to Dynatrace")}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {// Building the data string by concatenating sprintf calls for each metricmetrics := fmt.Sprintf(`doku.llm.request.duration,environment="%v",endpoint="%v",application="%v",source="%v",model="%v",platform="%v",generation="%v",job="doku" %v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], platform, call_type, data["requestDuration"]) + "\n" +fmt.Sprintf(`doku.llm.usage.cost,environment="%v",endpoint="%v",application="%v",source="%v",model="%v",platform="%v",generation="%v",job="doku" %v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], platform, call_type, data["usageCost"])diff --git a/src/ingester/connections/grafana-cloud.go b/src/ingester/connections/grafana-cloud.goindex 1c201608..a89903a8 100644--- a/src/ingester/connections/grafana-cloud.go+++ b/src/ingester/connections/grafana-cloud.go@@ -36,7 +36,7 @@ func configureGrafanaCloudData(data map[string]interface{}, config ConnectionConcall_type = "Unknown"}- if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" {+ if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["finishReason"] == nil {data["finishReason"] = "null"}@@ -68,7 +68,7 @@ func configureGrafanaCloudData(data map[string]interface{}, config ConnectionConif err != nil {log.Error().Err(err).Msgf("Error sending data to Grafana Cloud Loki")}- } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "mistral.embeddings" || data["endpoint"] == "azure.embeddings" {if data["endpoint"] == "openai.embeddings" {metrics := []string{fmt.Sprintf(`doku_llm,job=doku,environment=%v,endpoint=%v,applicationName=%v,source=%v,model=%v,platform=%v,generation=%v promptTokens=%v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], platform, call_type, data["promptTokens"]),@@ -119,7 +119,7 @@ func configureGrafanaCloudData(data map[string]interface{}, config ConnectionConif err != nil {log.Error().Err(err).Msgf("Error sending data to Grafana Cloud Prometheus")}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {metrics := []string{fmt.Sprintf(`doku_llm,job=doku,environment=%v,endpoint=%v,applicationName=%v,source=%v,model=%v,imageSize=%v,imageQuality=%v,platform=%v,generation=%v requestDuration=%v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], data["imageSize"], data["imageQuality"], platform, call_type, data["requestDuration"]),fmt.Sprintf(`doku_llm,job=doku,environment=%v,endpoint=%v,applicationName=%v,source=%v,model=%v,imageSize=%v,imageQuality=%v,platform=%v,generation=%v usageCost=%v`, data["environment"], data["endpoint"], data["applicationName"], data["sourceLanguage"], data["model"], data["imageSize"], data["imageQuality"], platform, call_type, data["usageCost"]),diff --git a/src/ingester/connections/newrelic.go b/src/ingester/connections/newrelic.goindex 6e4dd844..92790f34 100644--- a/src/ingester/connections/newrelic.go+++ b/src/ingester/connections/newrelic.go@@ -34,7 +34,7 @@ func configureNewRelicData(data map[string]interface{}, config ConnectionConfig)call_type = "Unknown"}- if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" {+ if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["finishReason"] == nil {data["finishReason"] = "null"}@@ -128,7 +128,7 @@ func configureNewRelicData(data map[string]interface{}, config ConnectionConfig)log.Error().Err(err).Msgf("Error sending Logs to New Relic")}- } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "mistral.embeddings" || data["endpoint"] == "azure.embeddings" {if data["endpoint"] == "openai.embeddings" {jsonMetrics := []string{fmt.Sprintf(`{@@ -281,7 +281,7 @@ func configureNewRelicData(data map[string]interface{}, config ConnectionConfig)if err != nil {log.Error().Err(err).Msgf("Error sending Metrics to New Relic")}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {jsonMetrics := []string{fmt.Sprintf(`{"name": "doku.LLM.Request.Duration",diff --git a/src/ingester/connections/signoz.go b/src/ingester/connections/signoz.goindex de66e5ee..ac88e489 100644--- a/src/ingester/connections/signoz.go+++ b/src/ingester/connections/signoz.go@@ -29,7 +29,7 @@ func configureSignozData(data map[string]interface{}, config ConnectionConfig) {call_type = "Unknown"}- if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" {+ if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["finishReason"] == nil {data["finishReason"] = "null"}@@ -68,7 +68,7 @@ func configureSignozData(data map[string]interface{}, config ConnectionConfig) {if err != nil {log.Error().Err(err).Msgf("Error sending Metrics to SigNoz")}- } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ } else if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "azure.embeddings" || data["endpoint"] == "mistral.embeddings" {jsonBody := fmt.Sprintf(`[{"trace_id": "",@@ -130,7 +130,7 @@ func configureSignozData(data map[string]interface{}, config ConnectionConfig) {if err != nil {log.Error().Err(err).Msgf("Error sending Metrics to SigNoz")}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {var promptMessage stringif data["model"] == "dall-e-2" {// Assuming data["prompt"] exists and is a stringdiff --git a/src/ingester/db/db.go b/src/ingester/db/db.goindex 73166f0c..626ed6af 100644--- a/src/ingester/db/db.go+++ b/src/ingester/db/db.go@@ -257,18 +257,18 @@ func getTokens(text, model string) int {// insertDataToDB inserts data into the database.func insertDataToDB(data map[string]interface{}) (string, int) {// Calculate usage cost based on the endpoint type- if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" {+ if data["endpoint"] == "openai.embeddings" || data["endpoint"] == "cohere.embed" || data["endpoint"] == "azure.embeddings" || data["endpoint"] == "mistral.embeddings" {data["usageCost"], _ = cost.CalculateEmbeddingsCost(data["promptTokens"].(float64), data["model"].(string))- } else if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "anthropic.messages" {+ } else if data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "cohere.chat" || data["endpoint"] == "cohere.summarize" || data["endpoint"] == "cohere.generate" || data["endpoint"] == "anthropic.messages" || data["endpoint"] == "mistral.chat" || data["endpoint"] == "azure.chat.completions" || data["endpoint"] == "azure.completions" {if data["completionTokens"] != nil && data["promptTokens"] != nil {data["usageCost"], _ = cost.CalculateChatCost(data["promptTokens"].(float64), data["completionTokens"].(float64), data["model"].(string))- } else if (data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions") && data["prompt"] != nil && data["response"] != nil {+ } else if (data["endpoint"] == "openai.chat.completions" || data["endpoint"] == "openai.completions" || data["endpoint"] == "azure.completions" || data["endpoint"] == "azure.chat.completions") && data["prompt"] != nil && data["response"] != nil {data["promptTokens"] = getTokens(data["prompt"].(string), data["model"].(string))data["completionTokens"] = getTokens(data["response"].(string), data["model"].(string))data["totalTokens"] = data["promptTokens"].(int) + data["completionTokens"].(int)data["usageCost"], _ = cost.CalculateChatCost(float64(data["promptTokens"].(int)), float64(data["completionTokens"].(int)), data["model"].(string))}- } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" {+ } else if data["endpoint"] == "openai.images.create" || data["endpoint"] == "openai.images.create.variations" || data["endpoint"] == "azure.images.create" {data["usageCost"], _ = cost.CalculateImageCost(data["model"].(string), data["imageSize"].(string), data["imageQuality"].(string))} else if data["endpoint"] == "openai.audio.speech.create" {data["usageCost"], _ = cost.CalculateAudioCost(data["prompt"].(string), data["model"].(string))