mint-o-badges / badgr-ui

GNU Affero General Public License v3.0
4 stars 2 forks source link

ui: use productive AI endpoint #138

Closed zven closed 5 months ago

zven commented 6 months ago

Apparently, only the port has changed, the rest stays the the same: http://49.12.65.167:3001/

timber-they commented 6 months ago

I adjusted it on the servers, feel free to test it, but there's no codebase changes that can be reviewed.

zven commented 5 months ago

At least on staging, nothing happens when I click on "Passende Kompetenzen vorschlagen"

Sending a request directly to the server works:

curl --request POST \
 --url 'http://49.12.65.167:3001/recommendations/chats?api_key=a61d2acd-de1b-48d5-a3a2-9f41c8f0b47e' \
 --header 'Content-Type: application/json' \
 --data '{
  "text_to_analyze" : "Dieser Kurs ist für alle geeignet, die gerne mehr zum Thema erfahren  und ins Handeln kommen möchten. Für Lehrende und MINT-Bildungsakteur:innen haben wir einen separaten und umfangreicheren Kurs erarbeitet, der auch Handlungsempfehlungen sowie didaktische Beispiele für die Schule und außerschulische Lernorte beinhaltet. Jedoch eignet sich dieser Kurs auch für den Einsatz im Unterricht mit  Schüler:innen."
}'

Response:

{
  "id": "21d9c56a-1218-4f74-a065-9a8359a296b9",
  "text_to_analyze": "Dieser Kurs ist für alle geeignet, die gerne mehr zum Thema erfahren  und ins Handeln kommen möchten. Für Lehrende und MINT-Bildungsakteur:innen haben wir einen separaten und umfangreicheren Kurs erarbeitet, der auch Handlungsempfehlungen sowie didaktische Beispiele für die Schule und außerschulische Lernorte beinhaltet. Jedoch eignet sich dieser Kurs auch für den Einsatz im Unterricht mit  Schüler:innen.",
  "skills": [
    {
      "preferred_label": "deliver online training",
      "alt_labels": [
        "deliver online training"
      ],
      "description": "Provide training by using online technologies, adapting the learning materials, using e-learning methods, supporting the trainees and communicating online. Instruct virtual classrooms.",
      "concept_uri": "/esco/skill/0d7f2cce-245a-4d02-9b8d-2e9946cc4c5d"
    },
    {
      "preferred_label": "understand spoken German",
      "alt_labels": [
        "interpret spoken German",
        "understanding spoken German",
        "understand spoken German",
        "understand German speech",
        "comprehend spoken German",
        "listen to German",
        "make sense of spoken German"
      ],
      "description": "Comprehend orally expressed German.",
      "concept_uri": "/esco/skill/1d5526b3-f17b-46fc-ba7d-f4a32d908a7e"
    },
    {
      "preferred_label": "interact verbally in German",
      "alt_labels": [
        "communicate verbally in German",
        "interact verbally in German",
        "speak German",
        "verbally interact in German",
        "interacting verbally in German",
        "be fluent in German"
      ],
      "description": "Communicate orally in German.",
      "concept_uri": "/esco/skill/2abb9db5-350c-444c-8292-0e0b2ce00f9a"
    },
    {
      "preferred_label": "understand written German",
      "alt_labels": [
        "comprehend written German",
        "understand German writing",
        "interpret written German",
        "understanding written German",
        "understand written German",
        "make sense of written German",
        "read German"
      ],
      "description": "Read and comprehend written texts in German.",
      "concept_uri": "/esco/skill/486e4f39-e968-41f4-955e-56e9eba96ef5"
    },
    {
      "preferred_label": "write German",
      "alt_labels": [
        "writing German",
        "correspond in written German",
        "show competency in written German",
        "write German"
      ],
      "description": "Compose written texts in German.",
      "concept_uri": "/esco/skill/52894650-9077-40f0-96d6-6f07d1a6cafa"
    },
    {
      "preferred_label": "e-learning",
      "alt_labels": [
        "e-learning"
      ],
      "description": "The strategies and didactical methods of learning in which the main elements include the use of ICT technologies.",
      "concept_uri": "/esco/skill/5f5e9350-1d13-4391-b9e1-07f6b2047fc5"
    },
    {
      "preferred_label": "instruct others",
      "alt_labels": [
        "train others",
        "instruct others",
        "instruct colleagues",
        "tutoring",
        "instructing others",
        "educate others",
        "teach others"
      ],
      "description": "Guide or teach others by providing relevant knowledge and support.",
      "concept_uri": "/esco/skill/699e7c26-6502-4e78-a823-3656ff5a5b8b"
    },
    {
      "preferred_label": "provide training on e-learning",
      "alt_labels": [
        "provide training on e-learning",
        "train the e-trainer"
      ],
      "description": "Give technical training including how to use an e-learning platform, training applications and standards such as SCORM, as well as e-teaching methods to the teacher or trainer.",
      "concept_uri": "/esco/skill/93a2f730-d5f6-4604-a25e-a2ee206ea468"
    },
    {
      "preferred_label": "develop digital educational materials",
      "alt_labels": [
        "develop instructional material for education",
        "develop digitized educational materials",
        "develop digital educational materials",
        "develop instructional material for educators",
        "develop educational resources",
        "develop instructional material",
        "develop educational materials"
      ],
      "description": "Create resources and instructional materials (e-learning, educational video and audio material, educational prezi) using digital technologies to transfer insight and awareness in order to improve learners’ expertise.",
      "concept_uri": "/esco/skill/b6d14ab8-3441-4cbe-8a0e-5b4f7f994730"
    },
    {
      "preferred_label": "teach further education",
      "alt_labels": [
        "teach further education",
        "teaches further education",
        "instruct further education",
        "teaching further education",
        "provide further education"
      ],
      "description": "Instruct adult students, not participating in standard higher education, in the theory and practice of one or several subjects with the aim of self-enrichment, ranging from academic areas such as mathematics and history to practical courses including languages and IT.",
      "concept_uri": "/esco/skill/f7dcf2e2-95f6-4061-a977-8d4c16dbceb2"
    }
  ],
  "status": "processed"
}

Related to this finding? https://github.com/mint-o-badges/badgr-ui/issues/160

timber-they commented 5 months ago

@zven yes this seems to be the same as #160. However, it has nothing to do with the productive endpoint, but rather with our implementation: It seems we can't handle üäö yet. Maybe I'll work on it in the other ticket then?

zven commented 5 months ago

@timber-they I see. Then we should address this in another ticket (e.g. that one: https://github.com/mint-o-badges/badgr-ui/issues/160). 👍

zven commented 5 months ago

@timber-they Did you also update the config for the staging environment or has something changed in between? Atm, the staging system seems to be talking to the mock backend.

timber-they commented 5 months ago

I can't reproduce this. However, it is a bit hard to test because apparently now with short texts the AI endpoint returns an error saying that the text is too short. This is new, though, and thus we don't handle it properly yet. With longer texts however the AI tool doesn't work with the state that's currently deployed on Staging, since the PR for the fix isn't reviewed yet. I suggest to create a separate ticket for handling the new error of the AI endpoint properly and closing this ticket again, except if you still have reasons to believe that Staging is talking to the mock backend, @zven.

zven commented 5 months ago

Very curious, now it works!

timber-they commented 5 months ago

I created the issue #203 for the short text problem.