Skip to content

Commit

Permalink
Merge pull request #1373 from Agenta-AI/main
Browse files Browse the repository at this point in the history
Merge main into add-revisions-endpoints
  • Loading branch information
aakrem authored Feb 15, 2024
2 parents 9eaf666 + 23fbf31 commit df7b4f9
Show file tree
Hide file tree
Showing 34 changed files with 111 additions and 243 deletions.
51 changes: 0 additions & 51 deletions agenta-backend/agenta_backend/migrations/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions agenta-backend/agenta_backend/models/api/organization_models.py

This file was deleted.

82 changes: 0 additions & 82 deletions agenta-backend/agenta_backend/routers/organization_router.py

This file was deleted.

7 changes: 6 additions & 1 deletion agenta-backend/agenta_backend/tasks/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def evaluate(
loop.run_until_complete(DBEngine().init_db())
app = loop.run_until_complete(fetch_app_by_id(app_id))
app_variant_db = loop.run_until_complete(fetch_app_variant_by_id(variant_id))
assert (
app_variant_db is not None
), f"App variant with id {variant_id} not found!"
app_variant_parameters = app_variant_db.config.parameters
testset_db = loop.run_until_complete(fetch_testset_by_id(testset_id))
new_evaluation_db = loop.run_until_complete(
Expand Down Expand Up @@ -180,10 +183,12 @@ def evaluate(
if correct_answer_column in data_point
else ""
)

loop.run_until_complete(
create_new_evaluation_scenario(
user=app.user,
organization=app.organization,
organization=app.organization if isCloudEE() else None,
workspace=app.workspace if isCloudEE() else None,
evaluation=new_evaluation_db,
variant_id=variant_id,
evaluators_configs=new_evaluation_db.evaluators_configs,
Expand Down
2 changes: 1 addition & 1 deletion agenta-backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta_backend"
version = "0.2.2"
version = "0.12.0"
description = ""
authors = ["Mahmoud Mabrouk <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion agenta-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta"
version = "0.10.3"
version = "0.12.0"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = ["Mahmoud Mabrouk <[email protected]>"]
Expand Down
29 changes: 10 additions & 19 deletions agenta-web/cypress/e2e/eval.comparison.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,26 @@ describe("Evaluation Comparison Test", function () {
beforeEach(() => {
cy.visit(`/apps/${app_id}/evaluations`)
cy.location("pathname").should("include", "/evaluations")
cy.get('[data-cy="evaluation-results-compare-button"]').should("exist")
cy.get('[data-cy="evaluation-results-delete-button"]').should("exist")
cy.get('[data-cy="new-evaluation-button"]').should("exist")
})

it("Should create 2 new Evaluations", () => {
Array.from({length: 2}).map((_) => {
cy.get('[data-cy="new-evaluation-button"]').click()
cy.get(".ant-modal-content").should("exist")

cy.get('[data-cy="select-testset-group"]').click()
cy.get('[data-cy="select-testset-option"]').click()

cy.get('[data-cy="select-variant-group"]').click()
cy.get('[data-cy="select-variant-option"]').eq(0).click()
cy.get('[data-cy="select-variant-group"]').click()

cy.get('[data-cy="select-evaluators-group"]').click()
cy.get('[data-cy="select-evaluators-option"]').eq(0).click()
cy.get('[data-cy="select-evaluators-group"]').click()

cy.get(
".ant-modal-footer > .ant-btn-primary > .ant-btn-icon > .anticon > svg",
).click()
cy.wait(1000)
cy.createNewEvaluation()
})
})

it("Should verify that there are completed evaluations in the list", () => {
cy.get('.ag-row[row-index="0"]').should("exist")
cy.get('.ag-row[row-index="1"]').should("exist")
cy.get('.ag-cell[col-id="status"]').should("contain.text", "Completed")
cy.get('.ag-cell[col-id="status"]', {timeout: 60000})
.eq(0)
.should("contain.text", "Completed")
cy.get('.ag-cell[col-id="status"]', {timeout: 60000})
.eq(1)
.should("contain.text", "Completed")
})

it("Should select 2 evaluations, click on the compare button, and successfully navigate to the comparison page", () => {
Expand Down
19 changes: 4 additions & 15 deletions agenta-web/cypress/e2e/eval.evaluations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,13 @@ describe("Evaluations CRUD Operations Test", function () {
beforeEach(() => {
cy.visit(`/apps/${app_id}/evaluations`)
cy.location("pathname").should("include", "/evaluations")
cy.get('[data-cy="evaluation-results-compare-button"]').should("exist")
cy.get('[data-cy="evaluation-results-delete-button"]').should("exist")
cy.get('[data-cy="new-evaluation-button"]').should("exist")
})

it("Should successfully create an Evaluation", () => {
cy.get('[data-cy="new-evaluation-button"]').click()
cy.get(".ant-modal-content").should("exist")

cy.get('[data-cy="select-testset-group"]').click()
cy.get('[data-cy="select-testset-option"]').click()

cy.get('[data-cy="select-variant-group"]').click()
cy.get('[data-cy="select-variant-option"]').eq(0).click()
cy.get('[data-cy="select-variant-group"]').click()

cy.get('[data-cy="select-evaluators-group"]').click()
cy.get('[data-cy="select-evaluators-option"]').eq(0).click()
cy.get('[data-cy="select-evaluators-group"]').click()

cy.get(".ant-modal-footer > .ant-btn-primary > .ant-btn-icon > .anticon > svg").click()
cy.createNewEvaluation()
})

it("Should throw warning when creating an evaluation without selecting testset, variants, and evaluators", () => {
Expand Down
3 changes: 3 additions & 0 deletions agenta-web/cypress/e2e/eval.evaluators.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ describe("Evaluators CRUD Operations Test", function () {
beforeEach(() => {
cy.visit(`/apps/${app_id}/evaluations`)
cy.location("pathname").should("include", "/evaluations")
cy.get('[data-cy="evaluation-results-compare-button"]').should("exist")
cy.get('[data-cy="evaluation-results-delete-button"]').should("exist")
cy.get('[data-cy="new-evaluation-button"]').should("exist")
cy.get("#rc-tabs-1-tab-evaluators > :nth-child(2)").click()
})

Expand Down
19 changes: 4 additions & 15 deletions agenta-web/cypress/e2e/eval.scenarios.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,13 @@ describe("Evaluation Scenarios Test", function () {
beforeEach(() => {
cy.visit(`/apps/${app_id}/evaluations`)
cy.location("pathname").should("include", "/evaluations")
cy.get('[data-cy="evaluation-results-compare-button"]').should("exist")
cy.get('[data-cy="evaluation-results-delete-button"]').should("exist")
cy.get('[data-cy="new-evaluation-button"]').should("exist")
})

it("Should successfully create an Evaluation", () => {
cy.get('[data-cy="new-evaluation-button"]').click()
cy.get(".ant-modal-content").should("exist")

cy.get('[data-cy="select-testset-group"]').click()
cy.get('[data-cy="select-testset-option"]').click()

cy.get('[data-cy="select-variant-group"]').click()
cy.get('[data-cy="select-variant-option"]').eq(0).click()
cy.get('[data-cy="select-variant-group"]').click()

cy.get('[data-cy="select-evaluators-group"]').click()
cy.get('[data-cy="select-evaluators-option"]').eq(0).click()
cy.get('[data-cy="select-evaluators-group"]').click()

cy.get(".ant-modal-footer > .ant-btn-primary > .ant-btn-icon > .anticon > svg").click()
cy.createNewEvaluation()
})

it("Should verify that evalaution was created and completed successfully", () => {
Expand Down
19 changes: 19 additions & 0 deletions agenta-web/cypress/support/commands/evaluations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,22 @@ Cypress.Commands.add("addingOpenaiKey", () => {
Cypress.Commands.add("removeLlmProviderKey", () => {
removeLlmProviderKey()
})

Cypress.Commands.add("createNewEvaluation", () => {
cy.get('[data-cy="new-evaluation-button"]').click()
cy.get(".ant-modal-content").should("exist")

cy.get('[data-cy="select-testset-group"]').click()
cy.get('[data-cy="select-testset-option"]').eq(0).click()

cy.get('[data-cy="select-variant-group"]').click()
cy.get('[data-cy="select-variant-option"]').eq(0).click()
cy.get('[data-cy="select-variant-group"]').click()

cy.get('[data-cy="select-evaluators-group"]').click()
cy.get('[data-cy="select-evaluators-option"]').eq(0).click()
cy.get('[data-cy="select-evaluators-group"]').click()

cy.get(".ant-modal-footer > .ant-btn-primary > .ant-btn-icon > .anticon > svg").click()
cy.wait(1000)
})
1 change: 1 addition & 0 deletions agenta-web/cypress/support/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare global {
saveOpenAiKey(): Chainable<void>
removeLlmProviderKey(): Chainable<void>
addingOpenaiKey(): Chainable<void>
createNewEvaluation(): Chainable<void>
}
}
}
4 changes: 2 additions & 2 deletions agenta-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashboard",
"version": "0.1.0",
"name": "agenta",
"version": "0.12.0",
"private": true,
"engines": {
"node": ">=18"
Expand Down
Loading

0 comments on commit df7b4f9

Please sign in to comment.