Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/oss/src/resources/evaluators/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@
"description": "Extract information from the user's response.",
"type": "object",
"properties": {
"score": {
"correctness": {
"type": "boolean",
"description": "The grade results",
}
},
"required": ["score"],
"required": ["correctness"],
"strict": True,
},
},
Expand Down Expand Up @@ -264,12 +264,12 @@
"description": "Extract information from the user's response.",
"type": "object",
"properties": {
"score": {
"correctness": {
"type": "boolean",
"description": "The hallucination detection result",
}
},
"required": ["score"],
"required": ["correctness"],
"strict": True,
},
},
Expand Down Expand Up @@ -339,12 +339,12 @@
"description": "Extract information from the user's response.",
"type": "object",
"properties": {
"score": {
"correctness": {
"type": "boolean",
"description": "The grade results",
}
},
"required": ["score"],
"required": ["correctness"],
"strict": True,
},
},
Expand Down
1 change: 1 addition & 0 deletions api/oss/src/services/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
HumanEvaluationScenario,
EvaluationScenarioOutput,
)
from oss.src.services import db_manager
from oss.src.models.db_models import (
EvaluationDB,
HumanEvaluationDB,
Expand Down
2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "api"
version = "0.62.1"
version = "0.62.0"
description = "Agenta API"
authors = [
{ name = "Mahmoud Mabrouk", email = "mahmoud@agenta.ai" },
Expand Down
12 changes: 4 additions & 8 deletions sdk/agenta/sdk/workflows/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,24 +511,20 @@ def field_match_test_v0(
correct_answer = inputs[correct_answer_key]

if not isinstance(outputs, str) and not isinstance(outputs, dict):
# raise InvalidOutputsV0Error(expected=["dict", "str"], got=outputs)
return {"success": False}
raise InvalidOutputsV0Error(expected=["dict", "str"], got=outputs)

outputs_dict = outputs
if isinstance(outputs, str):
try:
outputs_dict = loads(outputs)
except json.JSONDecodeError as e:
# raise InvalidOutputsV0Error(expected="dict", got=outputs) from e
return {"success": False}
raise InvalidOutputsV0Error(expected="dict", got=outputs) from e

if not isinstance(outputs_dict, dict):
# raise InvalidOutputsV0Error(expected=["dict", "str"], got=outputs)
return {"success": False}
raise InvalidOutputsV0Error(expected=["dict", "str"], got=outputs)

if not json_field in outputs_dict:
# raise MissingOutputV0Error(path=json_field)
return {"success": False}
raise MissingOutputV0Error(path=json_field)

# --------------------------------------------------------------------------
success = outputs_dict[json_field] == correct_answer
Expand Down
2 changes: 1 addition & 1 deletion sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "agenta"
version = "0.62.1"
version = "0.62.0"
description = "The SDK for agenta is an open-source LLMOps platform."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion web/ee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agenta/ee",
"version": "0.62.1",
"version": "0.62.0",
"private": true,
"engines": {
"node": ">=18"
Expand Down
2 changes: 1 addition & 1 deletion web/oss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agenta/oss",
"version": "0.62.1",
"version": "0.62.0",
"private": true,
"engines": {
"node": ">=18"
Expand Down
5 changes: 5 additions & 0 deletions web/oss/src/components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const EditorInner = forwardRef<HTMLDivElement, EditorProps>(
disabled = false,
tokens = [],
additionalCodePlugins = [],
showLineNumbers = true,
...rest
}: EditorProps,
ref,
Expand Down Expand Up @@ -311,6 +312,7 @@ const EditorInner = forwardRef<HTMLDivElement, EditorProps>(
className={clsx("editor-inner border rounded-lg min-h-[inherit]", {
"single-line": singleLine,
"code-editor": codeOnly,
"no-line-numbers": codeOnly && !showLineNumbers,
})}
style={
dimensions && dimensions.width
Expand Down Expand Up @@ -462,6 +464,7 @@ const Editor = ({
noProvider = false,
tokens = [],
additionalCodePlugins = [],
showLineNumbers = true,
...rest
}: EditorProps) => {
const {setContainerElm, dimensions: dimension} = useEditorResize({
Expand Down Expand Up @@ -494,6 +497,7 @@ const Editor = ({
validationSchema={validationSchema}
tokens={tokens}
additionalCodePlugins={additionalCodePlugins}
showLineNumbers={showLineNumbers}
/>
) : (
<EditorProvider
Expand Down Expand Up @@ -552,6 +556,7 @@ const Editor = ({
disabled={disabled}
tokens={tokens}
additionalCodePlugins={additionalCodePlugins}
showLineNumbers={showLineNumbers}
/>
</EditorProvider>
)}
Expand Down
1 change: 1 addition & 0 deletions web/oss/src/components/Editor/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface EditorProps extends React.HTMLProps<HTMLDivElement> {
/** Template format for prompt variable/tag highlighting */
templateFormat?: "curly" | "fstring" | "jinja2"
noProvider?: boolean
showLineNumbers?: boolean
/** Custom render function to override node rendering in Form view */
customRender?: CustomRenderFn
enableResize?: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useCallback, useRef, useState} from "react"
import {ChangeEvent, useCallback, useRef, useState} from "react"

import {Input} from "antd"
import clsx from "clsx"
Expand Down Expand Up @@ -32,6 +32,7 @@ const SharedEditor = ({
baseProperty,
variantId,
syncWithInitialValueChanges = false,
antdInputProps,
...props
}: SharedEditorProps) => {
const normalizedInitialValue = initialValue ?? ""
Expand Down Expand Up @@ -65,6 +66,13 @@ const SharedEditor = ({
mountInitialValueRef.current = normalizedInitialValue
}

const handleAntdInputChange = useCallback(
(event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
handleLocalValueChange(event.target.value)
},
[handleLocalValueChange],
)

return (
<div
className={clsx(
Expand Down Expand Up @@ -105,14 +113,27 @@ const SharedEditor = ({
{header}

{useAntdInput ? (
<Input
placeholder={placeholder}
value={localValue}
onChange={(value) => handleLocalValueChange(value.target.value)}
className={clsx("!bg-transparent", "!text-inherit", editorClassName)}
disabled={disabled}
{...editorProps}
/>
(() => {
const {className: antdClassName, textarea, ...antdRest} = antdInputProps ?? {}
const commonProps = {
placeholder,
value: localValue,
onChange: handleAntdInputChange,
className: clsx(
"!bg-transparent",
"!text-inherit",
editorClassName,
antdClassName,
),
disabled,
}

if (textarea) {
return <Input.TextArea {...commonProps} {...antdRest} />
}

return <Input {...commonProps} {...antdRest} />
})()
) : (
<EditorWrapper
placeholder={placeholder}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type {EditorProps} from "@/oss/components/Editor/types"
import type {InputProps, TextAreaProps} from "antd/es/input"

import type {BaseContainerProps} from "../types"

type SharedAntdInputProps = (InputProps & {textarea?: false}) | (TextAreaProps & {textarea: true})

export interface SharedEditorProps extends BaseContainerProps {
header?: React.ReactNode
footer?: React.ReactNode
Expand All @@ -15,6 +18,7 @@ export interface SharedEditorProps extends BaseContainerProps {
disabled?: boolean
editorProps?: EditorProps
useAntdInput?: boolean
antdInputProps?: SharedAntdInputProps
error?: boolean

noProvider?: boolean
Expand Down
Loading
Loading