Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ describe('Observability AI Assistant client', () => {
functionCalling: 'auto',
toolChoice: undefined,
tools: undefined,
metadata: {
connectorTelemetry: {
pluginId: 'observability_ai_assistant',
},
},
},
]);
});
Expand Down Expand Up @@ -847,6 +852,11 @@ describe('Observability AI Assistant client', () => {
functionCalling: 'auto',
toolChoice: 'auto',
tools: expect.any(Object),
metadata: {
connectorTelemetry: {
pluginId: 'observability_ai_assistant',
},
},
},
]);
});
Expand Down Expand Up @@ -996,6 +1006,11 @@ describe('Observability AI Assistant client', () => {
functionCalling: 'auto',
toolChoice: 'auto',
tools: expect.any(Object),
metadata: {
connectorTelemetry: {
pluginId: 'observability_ai_assistant',
},
},
},
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ export class ObservabilityAIAssistantClient {
toolChoice,
tools,
functionCalling: (simulateFunctionCalling ? 'simulated' : 'auto') as FunctionCallingMode,
metadata: {
connectorTelemetry: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the field is called telemetryMetadata, and should exist at the subActionParams level of the execute request. For example:

subActionParams: {
    telemetryMetadata: {
        pluginId: 'observability_ai_assistant'
    }
}

I've not used the inferenceClient.chatComplete, but you'll want to make sure this data is at the subActionParams level of wherever the connector call is being made

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @stephmilovic

The Inference ChatComplete API has metadata:

And that has connectorTelemetry -

export interface ChatCompleteMetadata {
connectorTelemetry?: ConnectorTelemetryMetadata;
}

And in the inference adapter, it gets passed as subActionParams to telemetryMetadata:

subActionParams: {
body: request,
signal: abortSignal,
...(metadata?.connectorTelemetry
? { telemetryMetadata: metadata.connectorTelemetry }
: {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, thanks!

pluginId: 'observability_ai_assistant',
},
},
};

this.dependencies.logger.debug(
Expand Down