feat: run prettier
This commit is contained in:
parent
2b40f2d822
commit
ecdb4f530d
8 changed files with 1119 additions and 437 deletions
|
|
@ -8,7 +8,7 @@ const mockDecodeSecretLocation = jest.fn();
|
|||
jest.unstable_mockModule("@continuedev/config-yaml", () => ({
|
||||
SecretType: {
|
||||
User: "user",
|
||||
Organization: "organization",
|
||||
Organization: "organization",
|
||||
FreeTrial: "free_trial",
|
||||
},
|
||||
decodeSecretLocation: mockDecodeSecretLocation,
|
||||
|
|
@ -341,4 +341,4 @@ test("usesFreeTrialApiKey should handle empty modelsByRole object", () => {
|
|||
const result = usesFreeTrialApiKey(config);
|
||||
expect(result).toBe(false);
|
||||
expect(mockDecodeSecretLocation).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,17 +20,17 @@ const TEST_EVENT: DevDataLogEvent = {
|
|||
};
|
||||
|
||||
const TEST_AGENT_INTERACTION_EVENT: DevDataLogEvent = {
|
||||
name: 'chatInteraction',
|
||||
name: "chatInteraction",
|
||||
data: {
|
||||
prompt: "Hello, world!",
|
||||
completion: "Hello, world!",
|
||||
modelProvider: "openai",
|
||||
modelTitle: "gpt-4",
|
||||
sessionId: "1234",
|
||||
tools: ['test-tool1']
|
||||
tools: ["test-tool1"],
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const SCHEMA = "0.2.0";
|
||||
|
||||
describe("DataLogger", () => {
|
||||
|
|
@ -171,22 +171,25 @@ describe("DataLogger", () => {
|
|||
expect(fileContent).toContain('"eventName":"tokensGenerated"');
|
||||
});
|
||||
|
||||
it('should write agent interaction data to local file', async () => {
|
||||
it("should write agent interaction data to local file", async () => {
|
||||
// Call the method to log data locally
|
||||
await dataLogger.logLocalData(TEST_AGENT_INTERACTION_EVENT);
|
||||
|
||||
// Verify the file was created
|
||||
const filepath = getDevDataFilePath(TEST_AGENT_INTERACTION_EVENT.name, SCHEMA);
|
||||
const filepath = getDevDataFilePath(
|
||||
TEST_AGENT_INTERACTION_EVENT.name,
|
||||
SCHEMA,
|
||||
);
|
||||
expect(fs.existsSync(filepath)).toBe(true);
|
||||
|
||||
// Read file contents and verify
|
||||
const fileContent = fs.readFileSync(filepath, "utf8");
|
||||
console.log('debug1 filecontent', fileContent)
|
||||
console.log("debug1 filecontent", fileContent);
|
||||
expect(fileContent).toContain('"eventName":"chatInteraction"');
|
||||
expect(fileContent).toContain('"prompt":"Hello, world!"');
|
||||
expect(fileContent).toContain('"completion":"Hello, world!"');
|
||||
expect(fileContent).toContain('"tools":["test-tool1"]');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
describe("logDevData", () => {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,8 @@ body[data-color-mode*="light"] {
|
|||
}
|
||||
.wmde-markdown {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif,
|
||||
font-family:
|
||||
-apple-system, "Segoe UI", Helvetica, Arial, sans-serif,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
}
|
||||
|
||||
.keyboard-key-normal {
|
||||
font-family: "JetBrains Mono", "SF Mono", Monaco, Menlo, Consolas,
|
||||
"Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New",
|
||||
monospace;
|
||||
font-family:
|
||||
"JetBrains Mono", "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono",
|
||||
"Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export const streamNormalInput = createAsyncThunk<
|
|||
modelProvider: selectedChatModel.underlyingProviderName,
|
||||
modelTitle: selectedChatModel.title,
|
||||
sessionId: state.session.id,
|
||||
...(state.session.mode === 'agent' && {
|
||||
...(state.session.mode === "agent" && {
|
||||
tools: activeTools.map((tool) => tool.function.name),
|
||||
}),
|
||||
},
|
||||
|
|
|
|||
1518
package-lock.json
generated
1518
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,5 +7,5 @@ export const chatInteractionEventAllSchema = baseDevDataAllSchema.extend({
|
|||
prompt: z.string(),
|
||||
completion: z.string(),
|
||||
sessionId: z.string(),
|
||||
tools: z.array(z.string()).optional()
|
||||
tools: z.array(z.string()).optional(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const chatInteractionEventSchema_0_2_0 =
|
|||
modelTitle: true,
|
||||
modelProvider: true,
|
||||
sessionId: true,
|
||||
tools: true
|
||||
tools: true,
|
||||
});
|
||||
|
||||
export const chatInteractionEventSchema_0_2_0_noCode =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue