Skip to content

Commit 70784fa

Browse files
committed
jupyter/llm: fix target language preview dependency and type it
1 parent 7b944e2 commit 70784fa

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/packages/frontend/account/i18n-selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Thank you for your patience and understanding as we work to make our application
6666
interface LanguageSelectorProps
6767
extends Omit<SelectProps, "options" | "onChange"> {
6868
value?: string;
69-
onChange?: (language: string) => void;
69+
onChange?: (language: Locale) => void;
7070
}
7171

7272
/**

src/packages/frontend/jupyter/llm/cell-tool.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ import LLMSelector, {
3737
modelToName,
3838
} from "@cocalc/frontend/frame-editors/llm/llm-selector";
3939
import { useLLMHistory } from "@cocalc/frontend/frame-editors/llm/use-llm-history";
40-
import { IntlMessage, labels, LOCALIZATIONS } from "@cocalc/frontend/i18n";
40+
import {
41+
IntlMessage,
42+
labels,
43+
Locale,
44+
LOCALIZATIONS,
45+
} from "@cocalc/frontend/i18n";
4146
import { backtickSequence } from "@cocalc/frontend/markdown/util";
4247
import { LLMCostEstimation } from "@cocalc/frontend/misc/llm-cost-estimation";
4348
import { useProjectContext } from "@cocalc/frontend/project/context";
@@ -461,7 +466,7 @@ export function LLMCellTool({ actions, id, style, llmTools, cellType }: Props) {
461466
const [targetLanguage, setTargetLanguage] =
462467
useState<TargetLanguage>("Python");
463468
const [otherLanguage, setOtherLanguage] = useState("");
464-
const [targetTextLanguage, setTargetTextLanguage] = useState<string>("es"); // Default to Spanish
469+
const [targetTextLanguage, setTargetTextLanguage] = useState<Locale>("es"); // Default to Spanish
465470
const [includeOutput, setIncludeOutput] = useState<boolean>(false);
466471
const [stepByStep, setStepByStep] = useState<boolean>(true);
467472
const [message, setMessage] = useState<string>("");
@@ -582,13 +587,14 @@ export function LLMCellTool({ actions, id, style, llmTools, cellType }: Props) {
582587
id,
583588
actions,
584589
llmTools?.model,
585-
includeOutput,
590+
cellTypes,
591+
contextRange,
586592
extra,
587-
targetLanguage,
593+
includeOutput,
588594
otherLanguage,
589595
stepByStep,
590-
contextRange,
591-
cellTypes,
596+
targetLanguage,
597+
targetTextLanguage,
592598
]);
593599

594600
// end of hooks

0 commit comments

Comments
 (0)