feat: financial agent template (#6246)
* add finacial assistant template * fix typos * Update tags Financial Agent.json * fix typo * template updated * Update sambanova_constants.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * updated Financial Agent Template * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * ✨ (Financial Agent.spec.ts): Add integration test for Financial Agent functionality ♻️ (select-gpt-model.ts): Refactor selectGptModel function to handle multiple dropdown options for GPT model selection * Update Financial Agent.json * Update Financial Agent.json * Update Financial Agent.json * notes-style * Update Financial Agent.json * Update Financial Agent.json * minor fix in notes --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: Jorge Piedrahita Ortiz <166410071+snova-jorgep@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
parent
b89ff12179
commit
932aee9cff
4 changed files with 3928 additions and 3 deletions
|
|
@ -3,6 +3,8 @@ SAMBANOVA_MODEL_NAMES = [
|
|||
"Meta-Llama-3.1-8B-Instruct",
|
||||
"Meta-Llama-3.1-70B-Instruct",
|
||||
"Meta-Llama-3.1-405B-Instruct",
|
||||
"DeepSeek-R1-Distill-Llama-70B",
|
||||
"DeepSeek-R1",
|
||||
"Meta-Llama-3.2-1B-Instruct",
|
||||
"Meta-Llama-3.2-3B-Instruct",
|
||||
"Llama-3.2-11B-Vision-Instruct",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
78
src/frontend/tests/core/integrations/Financial Agent.spec.ts
Normal file
78
src/frontend/tests/core/integrations/Financial Agent.spec.ts
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes";
|
||||
|
||||
withEventDeliveryModes(
|
||||
"Financial Agent",
|
||||
{ tag: ["@release", "@starter-projects"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.TAVILY_API_KEY,
|
||||
"TAVILY_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
test.skip(
|
||||
!process?.env?.SAMBANOVA_API_KEY,
|
||||
"SAMBANOVA_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
await page.goto("/");
|
||||
await awaitBootstrapTest(page);
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Financial Agent" }).click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-api_key")
|
||||
.nth(0)
|
||||
.fill(process.env.TAVILY_API_KEY ?? "");
|
||||
|
||||
for (let i = 0; i < 2; i++) {
|
||||
await page.getByTestId("dropdown_str_agent_llm").nth(i).click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByRole("option", { name: "SambaNova" }).click();
|
||||
}
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
await page
|
||||
.getByTestId("value-dropdown-dropdown_str_model_name")
|
||||
.nth(i)
|
||||
.click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByRole("option").first().click();
|
||||
}
|
||||
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-api_key")
|
||||
.nth(i)
|
||||
.fill(process.env.SAMBANOVA_API_KEY ?? "");
|
||||
}
|
||||
|
||||
await page.getByTestId("playground-btn-flow-io").click();
|
||||
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill("Why did Nvidia stock drop in January?");
|
||||
|
||||
await page.getByTestId("button-send").last().click();
|
||||
|
||||
const stopButton = page.getByRole("button", { name: "Stop" });
|
||||
await stopButton.waitFor({ state: "visible", timeout: 30000 });
|
||||
|
||||
if (await stopButton.isVisible()) {
|
||||
await expect(stopButton).toBeHidden({ timeout: 120000 });
|
||||
}
|
||||
|
||||
const output = await page
|
||||
.getByTestId("div-chat-message")
|
||||
.last()
|
||||
.innerText();
|
||||
expect(output.toLowerCase()).toContain("nvidia");
|
||||
expect(output.length).toBeGreaterThan(100);
|
||||
},
|
||||
);
|
||||
|
|
@ -5,8 +5,8 @@ export const selectGptModel = async (page: Page) => {
|
|||
.getByTestId("dropdown_str_model_name")
|
||||
.count();
|
||||
|
||||
if (gptModelDropdownCount > 0) {
|
||||
await page.getByTestId("dropdown_str_model_name").nth(0).click();
|
||||
await page.getByTestId("gpt-4o-1-option").click();
|
||||
for (let i = 0; i < gptModelDropdownCount; i++) {
|
||||
await page.getByTestId("dropdown_str_model_name").nth(i).click();
|
||||
await page.getByRole("option").first().click();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue