improv: clean up code
This commit is contained in:
parent
2820f43503
commit
d2545e48d2
4 changed files with 18 additions and 8 deletions
|
|
@ -36,7 +36,6 @@ async function modelConfigToBaseLLM({
|
|||
platformConfigMetadata: PlatformConfigMetadata | undefined;
|
||||
config: ContinueConfig;
|
||||
}): Promise<BaseLLM | undefined> {
|
||||
debugger;
|
||||
const cls = getModelClass(model);
|
||||
|
||||
if (!cls) {
|
||||
|
|
|
|||
|
|
@ -530,7 +530,6 @@ function compileChatMessages({
|
|||
}
|
||||
|
||||
const lastUserMessage = getLastUserMessage(msgsCopy);
|
||||
debugger;
|
||||
|
||||
msgsCopy = addSystemMessage({
|
||||
messages: msgsCopy,
|
||||
|
|
|
|||
|
|
@ -302,7 +302,6 @@ export abstract class BaseLLM implements ILLM {
|
|||
}
|
||||
|
||||
private _templatePromptLikeMessages(prompt: string): string {
|
||||
debugger;
|
||||
if (!this.templateMessages) {
|
||||
return prompt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,23 @@ const RuleCard: React.FC<RuleCardProps> = ({ index, rule, onClick, title }) => {
|
|||
);
|
||||
}
|
||||
|
||||
const renderRuleContent = () => {
|
||||
if (typeof rule === "string") {
|
||||
return <div>{rule}</div>;
|
||||
}
|
||||
|
||||
if (rule.rule) {
|
||||
return (
|
||||
<div>
|
||||
<div>{rule.rule}</div>
|
||||
{rule.if && <div className="text-gray-500">if: {rule.if}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <div>{JSON.stringify(rule)}</div>;
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -65,8 +82,7 @@ const RuleCard: React.FC<RuleCardProps> = ({ index, rule, onClick, title }) => {
|
|||
}}
|
||||
className="line-clamp-3 text-gray-400"
|
||||
>
|
||||
{/** TODO: Render the rule in a more readable way */}
|
||||
{JSON.stringify(rule)}
|
||||
{renderRuleContent()}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
|
|
@ -163,6 +179,3 @@ export function RulesSection() {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
function useTypedDispatch() {
|
||||
throw new Error("Function not implemented.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue