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
18 changes: 12 additions & 6 deletions packages/backend/server/src/plugins/copilot/providers/fal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class FalProvider extends CopilotProvider<FalConfig> {
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]);
Expand All @@ -283,7 +283,9 @@ export class FalProvider extends CopilotProvider<FalConfig> {
}
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);
}
}
Expand All @@ -296,12 +298,16 @@ export class FalProvider extends CopilotProvider<FalConfig> {
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;
}
}
Expand All @@ -319,7 +325,7 @@ export class FalProvider extends CopilotProvider<FalConfig> {
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(
Expand Down Expand Up @@ -376,7 +382,7 @@ export class FalProvider extends CopilotProvider<FalConfig> {
} catch (e) {
metrics.ai
.counter('generate_images_stream_errors')
.add(1, { model: model.id });
.add(1, this.metricLabels(model.id));
throw this.handleError(e);
}
}
Expand Down
12 changes: 8 additions & 4 deletions packages/backend/server/src/plugins/copilot/providers/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ export class OpenAIProvider extends CopilotProvider<OpenAIConfig> {
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);
Expand All @@ -687,7 +687,9 @@ export class OpenAIProvider extends CopilotProvider<OpenAIConfig> {
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);
}
}
Expand Down Expand Up @@ -983,7 +985,7 @@ export class OpenAIProvider extends CopilotProvider<OpenAIConfig> {

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');
Expand Down Expand Up @@ -1021,7 +1023,9 @@ export class OpenAIProvider extends CopilotProvider<OpenAIConfig> {
}
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);
}
}
Expand Down
12 changes: 10 additions & 2 deletions packages/frontend/core/src/desktop/dialogs/verify-email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,18 @@ export const VerifyEmailDialog = ({
>
<AuthHeader
title={serverName}
subTitle={t['com.affine.settings.email.action.change']()}
subTitle={
changeEmail
? t['com.affine.settings.email.action.change']()
: t['com.affine.settings.email.action.verify']()
}
/>
<AuthContent>
<p>{t['com.affine.auth.verify.email.message']({ email })}</p>
<p>
{changeEmail
? t['com.affine.auth.change.email.message']({ email })
: t['com.affine.auth.verify.email.message']({ email })}
</p>
<AuthInput
label={t['com.affine.settings.email']()}
disabled={true}
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/i18n/src/i18n.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ export function useAFFiNEI18N(): {
*/
["com.affine.appearanceSettings.showLinkedDocInSidebar.description"](): string;
/**
* `Your current email is {{email}}. We'll send a temporary verification link to this email.`
* `Your current email is {{email}}. We'll send a confirmation link there first so you can securely switch to a new email address.`
*/
["com.affine.auth.change.email.message"](options: {
readonly email: string;
Expand Down Expand Up @@ -1427,7 +1427,7 @@ export function useAFFiNEI18N(): {
*/
["com.affine.auth.toast.title.signed-in"](): string;
/**
* `Your current email is {{email}}. We'll send a temporary verification link to this email.`
* `Your current email is {{email}}. We'll send a verification link to this email so you can confirm it belongs to you.`
*/
["com.affine.auth.verify.email.message"](options: {
readonly email: string;
Expand Down Expand Up @@ -9897,7 +9897,7 @@ export const TypedTrans: {
["2"]: JSX.Element;
}>>;
/**
* `<1>{{username}}</1> has accept your invitation`
* `<1>{{username}}</1> has accepted your invitation`
*/
["com.affine.notification.invitation-accepted"]: ComponentType<TypedTransProps<{
readonly username: string;
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/i18n/src/resources/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@
"com.affine.import.modal.tip": "Wenn du Unterstützung für zusätzliche Dateitypen anfordern möchtest, lass es uns gerne wissen auf",
"com.affine.import.notion": "Notion",
"com.affine.import.notion.tooltip": "Importiere deine Notion-Daten. Unterstützte Importformate: HTML mit Unterseiten.",
"com.affine.import.obsidian": "Obsidian-Vault",
"com.affine.import.obsidian.tooltip": "Importiere einen Obsidian-Vault. Wähle einen Ordner aus, um alle Notizen, Bilder und Assets mit aufgelösten Wiki-Links zu importieren.",
"com.affine.import.snapshot": "Snapshot",
"com.affine.import.snapshot.tooltip": "Importiere deine AFFiNE-Workspace- und Seiten-Snapshot-Datei.",
"com.affine.import.dotaffinefile": ".affine-Datei",
Expand Down Expand Up @@ -2129,6 +2131,7 @@
"com.affine.integration.calendar.no-calendar": "Noch keine abonnierten Kalender.",
"com.affine.integration.mcp-server.name": "MCP-Server",
"com.affine.integration.mcp-server.desc": "Anderen MCP-Clients ermöglichen, die Seite von AFFiNE zu suchen und zu lesen.",
"com.affine.integration.mcp-server.copy-json.disabled-hint": "Der MCP-Token wird nur einmal angezeigt. Lösche ihn und erstelle ihn neu, um die JSON-Konfiguration zu kopieren.",
"com.affine.audio.notes": "Notizen",
"com.affine.audio.transcribing": "Transkription läuft",
"com.affine.audio.transcribe.non-owner.confirm.title": "KI-Ergebnisse für andere können nicht abgerufen werden",
Expand Down Expand Up @@ -2176,6 +2179,7 @@
"error.SSRF_BLOCKED_ERROR": "Ungültige URL",
"error.RESPONSE_TOO_LARGE_ERROR": "Antwort zu groß ({{receivedBytes}} Bytes), Limit beträgt {{limitBytes}} Bytes",
"error.EMAIL_SERVICE_NOT_CONFIGURED": "E-Mail-Dienst ist nicht konfiguriert.",
"error.IMAGE_FORMAT_NOT_SUPPORTED": "Bildformat nicht unterstützt: {{format}}",
"error.QUERY_TOO_LONG": "Abfrage ist zu lang, die maximale Länge beträgt {{max}}.",
"error.VALIDATION_ERROR": "Validierungsfehler, Fehler: {{errors}}",
"error.USER_NOT_FOUND": "Benutzer nicht gefunden.",
Expand Down Expand Up @@ -2291,7 +2295,7 @@
"error.CANNOT_DELETE_ACCOUNT_WITH_OWNED_TEAM_WORKSPACE": "Konto kann nicht gelöscht werden. Du bist Besitzer eines oder mehrerer Team-Workspaces. Bitte übertrage den Besitz oder lösche die Workspaces zuerst.",
"error.CAPTCHA_VERIFICATION_FAILED": "Captcha-Überprüfung fehlgeschlagen.",
"error.INVALID_LICENSE_SESSION_ID": "Ungültige Sitzungs-ID zur Erstellung des Lizenzschlüssels.",
"error.LICENSE_REVEALED": "Der Lizenzschlüssel wurde aufgedeckt. Bitte überprüfe dein Postfach, das du beim Bezahlvorgang angegeben hast.",
"error.LICENSE_REVEALED": "Der Lizenzschlüssel wurde angezeigt. Bitte überprüfe dein Postfach, das du beim Bezahlvorgang angegeben hast.",
"error.WORKSPACE_LICENSE_ALREADY_EXISTS": "Workspace hat bereits eine Lizenz angewendet.",
"error.LICENSE_NOT_FOUND": "Lizenz nicht gefunden.",
"error.INVALID_LICENSE_TO_ACTIVATE": "Ungültige Lizenz zum Aktivieren. {{reason}}",
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/i18n/src/resources/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"com.affine.appearanceSettings.translucentUI.title": "Translucent UI on the sidebar",
"com.affine.appearanceSettings.showLinkedDocInSidebar.title": "Show linked doc in sidebar",
"com.affine.appearanceSettings.showLinkedDocInSidebar.description": "Control whether to show the structure of linked docs in the sidebar.",
"com.affine.auth.change.email.message": "Your current email is {{email}}. We'll send a temporary verification link to this email.",
"com.affine.auth.change.email.message": "Your current email is {{email}}. We'll send a confirmation link there first so you can securely switch to a new email address.",
"com.affine.auth.change.email.page.subtitle": "Please enter your new email address below. We will send a verification link to this email address to complete the process.",
"com.affine.auth.change.email.page.success.subtitle": "Congratulations! You have successfully updated the email address associated with your AFFiNE Cloud account.",
"com.affine.auth.change.email.page.success.title": "Email address updated!",
Expand Down Expand Up @@ -347,7 +347,7 @@
"com.affine.auth.toast.message.signed-in": "You have been signed in, start to sync your data with AFFiNE Cloud!",
"com.affine.auth.toast.title.failed": "Unable to sign in",
"com.affine.auth.toast.title.signed-in": "Signed in",
"com.affine.auth.verify.email.message": "Your current email is {{email}}. We'll send a temporary verification link to this email.",
"com.affine.auth.verify.email.message": "Your current email is {{email}}. We'll send a verification link to this email so you can confirm it belongs to you.",
"com.affine.backButton": "Back",
"com.affine.banner.content": "This demo is limited. <1>Download the AFFiNE Client</1> 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!",
Expand Down Expand Up @@ -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}}</1> has accept your invitation",
"com.affine.notification.invitation-accepted": "<1>{{username}}</1> has accepted your invitation",
"com.affine.notification.invitation-review-request": "<1>{{username}}</1> has requested to join <2>{{workspaceName}}</2>",
"com.affine.notification.invitation-review-declined": "<1>{{username}}</1> has declined your request to join <2>{{workspaceName}}</2>",
"com.affine.notification.invitation-review-approved": "<1>{{username}}</1> has approved your request to join <2>{{workspaceName}}</2>",
Expand Down
Loading