Skip to content

Conversation

@m-messer
Copy link
Member

@m-messer m-messer commented Aug 8, 2025

This feature replicates the cases feature in BaseEvaluationFunctionLayer.

The feedback case returned is the first match, which is the current implementation, but it should be possible to return multiple cases if that is the preference.

There is a test suite in runtime/handler_test.go, and if you want to test with Postman, you will have to clone, update and build the following locally:

  1. Clone and build this repo with docker build -t shimmy .
  2. evaluation-function-base
    • You will need to update the Python Dockerfile to build from the local shimmy tag From shimmy:latest
    • Build this image docker build -t eval-func-base-python
  3. Python Boilerplate
    • You will need to update the Dockerfile to build from the local eval-func-base-python as both builder and later in the Dockerfile
    • You will also have to name your evaluation function in the config.json file (I use Test), this will be your endpoint name
  4. Run docker run -p 8080:8080 eval-func-base-python to run the evaluation function
  5. Use Postman to send the POST request to get feedback (examples below)

Example POST requests:
No cases:

{
    "response": "hello", "answer": "hello"
}

Single case:

{
    "response": "other", 
    "answer": "hello",
    "params": {
        "cases": [
            {
                "answer": "other",
                "feedback": "single feedback case match"
            }
        ]
    }
}

Many cases:

{
    "response": "other", 
    "answer": "hello",
    "params": {
        "cases": [
            {
                "answer": "hi",
                "feedback": "single feedback case match"
            },
             {
                "answer": "other",
                "feedback": "second feedback case match"
            }
        ]
    }
}

m-messer added 22 commits August 5, 2025 11:19
…aluatio function to change on provided input and to get the wanted output.
@neagualexa neagualexa removed their assignment Aug 11, 2025
@m-messer m-messer self-assigned this Aug 11, 2025
@m-messer m-messer merged commit 20454c2 into main Aug 11, 2025
8 checks passed
@m-messer m-messer deleted the feature/cases branch August 11, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants