Skip to content

Commit

Permalink
Merge branch 'main' into issue-957/-use-FE-host-as-BE-host
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed Nov 30, 2023
2 parents eec139f + eb541a2 commit 6641088
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: black-check-action
name: Check Python Code - Black
on:
pull_request:
paths:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and Build
name: Check Web Code - Lint and Build

on:
pull_request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prettier
name: Check web Code - Prettier

on:
pull_request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Agenta to PyPI
name: Publish to PyPI

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Publish Docker Images
name: Push to GitHub Container Registry

on:
on:
workflow_dispatch:
push:
branches:
- main
Expand Down Expand Up @@ -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: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Execute Backend tests
name: Run Backend tests

on: [pull_request]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Execute Frontend tests
name: Run Frontend tests

on: [pull_request]
env:
Expand All @@ -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 }}
Expand All @@ -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/

Expand Down Expand Up @@ -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
5 changes: 1 addition & 4 deletions agenta-cli/agenta/sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.5.8"
version = "0.6.0"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = ["Mahmoud Mabrouk <[email protected]>"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -54,7 +53,7 @@ const AddAppFromTemplatedModal: React.FC<Props> = ({
Choose template
</Title>
}
width={templates.length <= 1 || !!noTemplateMessage ? 620 : 900}
width={templates.length <= 1 || !!noTemplateMessage ? 620 : 700}
{...props}
>
<div className={classes.body}>
Expand All @@ -69,7 +68,7 @@ const AddAppFromTemplatedModal: React.FC<Props> = ({
</div>
) : (
templates.map((template) => (
<div key={template.id}>
<div key={template.id} style={{flex: 1}}>
<AppTemplateCard
title={template.image.title}
body={template.image.description}
Expand Down
10 changes: 6 additions & 4 deletions agenta-web/src/lib/helpers/openapi_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ const getBodySchemaName = (schema: GenericObject): string => {

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[] => {
Expand All @@ -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 : [],
Expand Down
30 changes: 0 additions & 30 deletions commit_private.sh

This file was deleted.

6 changes: 2 additions & 4 deletions examples/startup_technical_ideas/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
31 changes: 0 additions & 31 deletions setup_agenta_web.sh

This file was deleted.

1 change: 0 additions & 1 deletion setup_ee.sh

This file was deleted.

22 changes: 0 additions & 22 deletions wait_on_api.sh

This file was deleted.

0 comments on commit 6641088

Please sign in to comment.