diff --git a/packages/backend/server/src/plugins/copilot/providers/fal.ts b/packages/backend/server/src/plugins/copilot/providers/fal.ts index b6927a141d404..d875ac8bf2388 100644 --- a/packages/backend/server/src/plugins/copilot/providers/fal.ts +++ b/packages/backend/server/src/plugins/copilot/providers/fal.ts @@ -258,7 +258,7 @@ export class FalProvider extends CopilotProvider { const model = this.selectModel(cond); try { - metrics.ai.counter('chat_text_calls').add(1, { model: model.id }); + metrics.ai.counter('chat_text_calls').add(1, this.metricLabels(model.id)); // by default, image prompt assumes there is only one message const prompt = this.extractPrompt(messages[messages.length - 1]); @@ -283,7 +283,9 @@ export class FalProvider extends CopilotProvider { } return data.output; } catch (e: any) { - metrics.ai.counter('chat_text_errors').add(1, { model: model.id }); + metrics.ai + .counter('chat_text_errors') + .add(1, this.metricLabels(model.id)); throw this.handleError(e); } } @@ -296,12 +298,16 @@ export class FalProvider extends CopilotProvider { const model = this.selectModel(cond); try { - metrics.ai.counter('chat_text_stream_calls').add(1, { model: model.id }); + metrics.ai + .counter('chat_text_stream_calls') + .add(1, this.metricLabels(model.id)); const result = await this.text(cond, messages, options); yield result; } catch (e) { - metrics.ai.counter('chat_text_stream_errors').add(1, { model: model.id }); + metrics.ai + .counter('chat_text_stream_errors') + .add(1, this.metricLabels(model.id)); throw e; } } @@ -319,7 +325,7 @@ export class FalProvider extends CopilotProvider { try { metrics.ai .counter('generate_images_stream_calls') - .add(1, { model: model.id }); + .add(1, this.metricLabels(model.id)); // by default, image prompt assumes there is only one message const prompt = this.extractPrompt( @@ -376,7 +382,7 @@ export class FalProvider extends CopilotProvider { } catch (e) { metrics.ai .counter('generate_images_stream_errors') - .add(1, { model: model.id }); + .add(1, this.metricLabels(model.id)); throw this.handleError(e); } } diff --git a/packages/backend/server/src/plugins/copilot/providers/openai.ts b/packages/backend/server/src/plugins/copilot/providers/openai.ts index 318d0845e4b75..1c77626cfacce 100644 --- a/packages/backend/server/src/plugins/copilot/providers/openai.ts +++ b/packages/backend/server/src/plugins/copilot/providers/openai.ts @@ -664,7 +664,7 @@ export class OpenAIProvider extends CopilotProvider { const model = this.selectModel(normalizedCond); try { - metrics.ai.counter('chat_text_calls').add(1, { model: model.id }); + metrics.ai.counter('chat_text_calls').add(1, this.metricLabels(model.id)); const backendConfig = this.createNativeConfig(); const middleware = this.getActiveProviderMiddleware(); const cap = this.getAttachCapability(model, ModelOutputType.Structured); @@ -687,7 +687,9 @@ export class OpenAIProvider extends CopilotProvider { const validated = schema.parse(parsed); return JSON.stringify(validated); } catch (e: any) { - metrics.ai.counter('chat_text_errors').add(1, { model: model.id }); + metrics.ai + .counter('chat_text_errors') + .add(1, this.metricLabels(model.id)); throw this.handleError(e); } } @@ -983,7 +985,7 @@ export class OpenAIProvider extends CopilotProvider { metrics.ai .counter('generate_images_stream_calls') - .add(1, { model: model.id }); + .add(1, this.metricLabels(model.id)); const { content: prompt, attachments } = [...messages].pop() || {}; if (!prompt) throw new CopilotPromptInvalid('Prompt is required'); @@ -1021,7 +1023,9 @@ export class OpenAIProvider extends CopilotProvider { } return; } catch (e: any) { - metrics.ai.counter('generate_images_errors').add(1, { model: model.id }); + metrics.ai + .counter('generate_images_errors') + .add(1, this.metricLabels(model.id)); throw this.handleError(e); } } diff --git a/packages/frontend/core/src/desktop/dialogs/verify-email/index.tsx b/packages/frontend/core/src/desktop/dialogs/verify-email/index.tsx index a95db4456c916..a079aaca1055b 100644 --- a/packages/frontend/core/src/desktop/dialogs/verify-email/index.tsx +++ b/packages/frontend/core/src/desktop/dialogs/verify-email/index.tsx @@ -108,10 +108,18 @@ export const VerifyEmailDialog = ({ > -

{t['com.affine.auth.verify.email.message']({ email })}

+

+ {changeEmail + ? t['com.affine.auth.change.email.message']({ email }) + : t['com.affine.auth.verify.email.message']({ email })} +

>; /** - * `<1>{{username}} has accept your invitation` + * `<1>{{username}} has accepted your invitation` */ ["com.affine.notification.invitation-accepted"]: ComponentTypeDownload the AFFiNE Client for the latest features and Performance.", "com.affine.banner.local-warning": "Your local data is stored in the browser and may be lost. Don't risk it - enable cloud now!", @@ -1994,7 +1994,7 @@ "com.affine.notification.empty": "No new notifications", "com.affine.notification.loading-more": "Loading more...", "com.affine.notification.empty.description": "You'll be notified here for @mentions and workspace invites.", - "com.affine.notification.invitation-accepted": "<1>{{username}} has accept your invitation", + "com.affine.notification.invitation-accepted": "<1>{{username}} has accepted your invitation", "com.affine.notification.invitation-review-request": "<1>{{username}} has requested to join <2>{{workspaceName}}", "com.affine.notification.invitation-review-declined": "<1>{{username}} has declined your request to join <2>{{workspaceName}}", "com.affine.notification.invitation-review-approved": "<1>{{username}} has approved your request to join <2>{{workspaceName}}",