diff --git a/.github/workflows/black.yml b/.github/workflows/check-python-code-black.yml similarity index 89% rename from .github/workflows/black.yml rename to .github/workflows/check-python-code-black.yml index 10b9572f1b..8179105f17 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/check-python-code-black.yml @@ -1,4 +1,4 @@ -name: black-check-action +name: Check Python Code - Black on: pull_request: paths: diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/check-web-code-lint-and-build.yml similarity index 93% rename from .github/workflows/lint-and-build.yml rename to .github/workflows/check-web-code-lint-and-build.yml index 3a6cdaa038..516d28b1c8 100644 --- a/.github/workflows/lint-and-build.yml +++ b/.github/workflows/check-web-code-lint-and-build.yml @@ -1,4 +1,4 @@ -name: Lint and Build +name: Check Web Code - Lint and Build on: pull_request: diff --git a/.github/workflows/prettier.yml b/.github/workflows/check-web-code-prettier.yml similarity index 92% rename from .github/workflows/prettier.yml rename to .github/workflows/check-web-code-prettier.yml index 9a582ff5ee..23f7a8389e 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/check-web-code-prettier.yml @@ -1,4 +1,4 @@ -name: Prettier +name: Check web Code - Prettier on: pull_request: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-to-pypi.yml similarity index 98% rename from .github/workflows/publish.yml rename to .github/workflows/publish-to-pypi.yml index 31675c3789..8fcaa8d0b8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,4 +1,4 @@ -name: Publish Agenta to PyPI +name: Publish to PyPI on: push: diff --git a/.github/workflows/docker.yml b/.github/workflows/push-to-ghcr.yml similarity index 95% rename from .github/workflows/docker.yml rename to .github/workflows/push-to-ghcr.yml index 186f6e22cd..d594bf193e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/push-to-ghcr.yml @@ -1,6 +1,7 @@ -name: Build and Publish Docker Images +name: Push to GitHub Container Registry -on: +on: + workflow_dispatch: push: branches: - main @@ -33,7 +34,7 @@ jobs: registry: ghcr.io username: ${{ env.REPOSITORY_USERNAME }} password: ${{ secrets.DOCKER_GITHUB_SECRETS }} - + - name: Build, tag and push Backend image to Github Container Registry id: build-backend-image run: | diff --git a/.github/workflows/backend_test.yml b/.github/workflows/run-backend-tests.yml similarity index 95% rename from .github/workflows/backend_test.yml rename to .github/workflows/run-backend-tests.yml index bc322796cc..5a5f2b78e3 100644 --- a/.github/workflows/backend_test.yml +++ b/.github/workflows/run-backend-tests.yml @@ -1,4 +1,4 @@ -name: Execute Backend tests +name: Run Backend tests on: [pull_request] diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/run-frontend-tests.yml similarity index 93% rename from .github/workflows/frontend-tests.yml rename to .github/workflows/run-frontend-tests.yml index d51b2c6f03..693d78a538 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/run-frontend-tests.yml @@ -1,4 +1,4 @@ -name: Execute Frontend tests +name: Run Frontend tests on: [pull_request] env: @@ -11,11 +11,11 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 - + - name: Set Environment Variables run: | echo "NEXT_PUBLIC_OPENAI_API_KEY=${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}" >> $GITHUB_ENV - + - name: Install Curl & Start Docker Compose env: NEXT_PUBLIC_OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }} @@ -25,7 +25,7 @@ jobs: - name: Restart Backend Service To Fetch Template(s) run: docker container restart agenta_backend_1 - + - name: Wait for Backend Service run: curl http://localhost/api/health/ @@ -53,6 +53,6 @@ jobs: - name: Docker logs if: always() # run: docker ps -q | xargs -I {} docker logs {} - + - name: Stop Docker Compose run: docker-compose down diff --git a/agenta-cli/agenta/sdk/types.py b/agenta-cli/agenta/sdk/types.py index 38da0b018c..080eb9d8fd 100644 --- a/agenta-cli/agenta/sdk/types.py +++ b/agenta-cli/agenta/sdk/types.py @@ -116,11 +116,8 @@ class MessagesInput(list): """ def __new__(cls, messages: List[Dict[str, str]] = None): - if not messages: - raise ValueError("Missing required parameter in MessagesInput") - instance = super().__new__(cls, messages) - instance.messages = messages + instance.default = messages return instance @classmethod diff --git a/agenta-cli/pyproject.toml b/agenta-cli/pyproject.toml index 2f53734622..5204a81193 100644 --- a/agenta-cli/pyproject.toml +++ b/agenta-cli/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "agenta" -version = "0.5.8" +version = "0.6.0" description = "The SDK for agenta is an open-source LLMOps platform." readme = "README.md" authors = ["Mahmoud Mabrouk "] diff --git a/agenta-web/src/components/AppSelector/modals/AddAppFromTemplateModal.tsx b/agenta-web/src/components/AppSelector/modals/AddAppFromTemplateModal.tsx index 94e1db3d9b..2a7e3069fb 100644 --- a/agenta-web/src/components/AppSelector/modals/AddAppFromTemplateModal.tsx +++ b/agenta-web/src/components/AppSelector/modals/AddAppFromTemplateModal.tsx @@ -16,8 +16,7 @@ const useStyles = createUseStyles({ body: { width: "100%", marginTop: 20, - display: "grid", - gridTemplateColumns: "repeat(auto-fill, minmax(min(240px, 100%), 1fr))", + display: "flex", gap: 20, }, row: { @@ -54,7 +53,7 @@ const AddAppFromTemplatedModal: React.FC = ({ Choose template } - width={templates.length <= 1 || !!noTemplateMessage ? 620 : 900} + width={templates.length <= 1 || !!noTemplateMessage ? 620 : 700} {...props} >
@@ -69,7 +68,7 @@ const AddAppFromTemplatedModal: React.FC = ({
) : ( templates.map((template) => ( -
+
{ export const detectChatVariantFromOpenAISchema = (schema: GenericObject) => { const bodySchemaName = getBodySchemaName(schema) - return ( - schema.components.schemas[bodySchemaName].properties?.inputs?.["x-parameter"] === "messages" - ) + const bodyProperties = schema.components.schemas[bodySchemaName].properties + const propertiesWithMessages = Object.keys(bodyProperties).filter((property) => { + return bodyProperties[property]["x-parameter"] === "messages" + }) + return propertiesWithMessages[0] === "messages" } export const openAISchemaToParameters = (schema: GenericObject): Parameter[] => { @@ -35,7 +37,7 @@ export const openAISchemaToParameters = (schema: GenericObject): Parameter[] => ([name, param]: [string, any]) => { const parameter = { name: name, - input: param["x-parameter"] ? false : true, + input: param["x-parameter"] ? false || param["x-parameter"] === "messages" : true, type: param["x-parameter"] ? determineType(param["x-parameter"]) : "string", default: param.default, enum: param["enum"] ? param.enum : [], diff --git a/commit_private.sh b/commit_private.sh deleted file mode 100755 index a2b4b828d5..0000000000 --- a/commit_private.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Given that the `ee/` folder structure always mirrors the `agenta-web/` folder structure, -# we only need to maintain a list of files and folders to sync. - -# Define the files and folders to copy in an array. -ITEMS_TO_SYNC=( - "agenta-web/src/components/Sidebar/Sidebar.tsx" - "agenta-web/src/config" - "agenta-web/src/pages/auth" - "agenta-web/src/_app.tsx" -) - -# Copy the items -for ITEM in "${ITEMS_TO_SYNC[@]}"; do - DEST="ee/${ITEM#agenta-web/}" # Construct the destination path - if [ -d "$ITEM" ]; then - # If item is a directory - cp -R "$ITEM" "$(dirname "$DEST")" - else - # If item is a file - cp "$ITEM" "$DEST" - fi -done - -# Use provided commit message or default to "ee: update agenta-web" -COMMIT_MSG="${1:-ee: update agenta-web}" - -git add ee/ && git commit -m "$COMMIT_MSG" -git push origin private diff --git a/examples/startup_technical_ideas/app.py b/examples/startup_technical_ideas/app.py index 57e2ae4461..8838e51852 100644 --- a/examples/startup_technical_ideas/app.py +++ b/examples/startup_technical_ideas/app.py @@ -23,10 +23,8 @@ @ag.entrypoint -def chat( - messages: MessagesInput = MessagesInput([{"role": "string", "content": "string"}]) -) -> str: - messages = [{"role": "system", "content": ag.config.system_prompt}] + messages +def chat(messages: MessagesInput = MessagesInput()) -> str: + messages = [{"role": "system", "content": ag.config.prompt_system}] + messages max_tokens = ag.config.max_tokens if ag.config.max_tokens != -1 else None chat_completion = client.chat.completions.create( model=ag.config.model, diff --git a/setup_agenta_web.sh b/setup_agenta_web.sh deleted file mode 100755 index 9d1cde4b94..0000000000 --- a/setup_agenta_web.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -source .env -echo $DOMAIN_NAME - -update_env_var() { - key="$1" - new_value="$2" - file="$3" - - # check if the key exists in the file - if grep -q $key $file; then - # the key exists, replace the line with new key value pair - sed -i'' "s#^$key=.*#$key=$new_value#" $file - else - # the key does not exist, add to the file - echo "$key=$new_value" >> $file - fi -} - - -# TODO: ensure that when we do the replace the quotes "" are not escaped and are included -update_env_var "NEXT_PUBLIC_AGENTA_API_URL" "${DOMAIN_NAME:=http://localhost}" "./agenta-web/.env" -update_env_var "NEXT_PUBLIC_FF" oss "./agenta-web/.env" - -# Copy the .env.local.example to .env.local if it doesn't exist -if ! [ -e ./agenta-web/.env.local ] ; then - cp ./agenta-web/.env.local.example ./agenta-web/.env.local -fi - -# docker-compose -f docker-compose.prod.yml up diff --git a/setup_ee.sh b/setup_ee.sh deleted file mode 100755 index 289ca6578c..0000000000 --- a/setup_ee.sh +++ /dev/null @@ -1 +0,0 @@ -cp -R ee/agenta-web/src/* agenta-web/src/ \ No newline at end of file diff --git a/wait_on_api.sh b/wait_on_api.sh deleted file mode 100644 index afc1f767ee..0000000000 --- a/wait_on_api.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -delay=2 - -if [[ ! -z $3 ]]; then - delay=$3 -fi - -while true; do - url="http://localhost/api/$1" - echo "Calling API URL: $url" - response=$(curl -s $url -H "Accept: application/json" -H "Content-Type: application/json") - startsWith="$2*" - - echo "Check if response starts with: $2" - echo "Response is: $response" - - if [[ $response == $startsWith ]]; then - echo "API is up!" - break - fi - sleep $delay -done \ No newline at end of file