Skip to content

Moodle plugin that implements an interaction with a language model through a web service

License

Notifications You must be signed in to change notification settings

C4AI/moodle-local_harpiaajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moodle plugin: HarpIA Ajax

HarpIA Ajax is a Moodle plugin that implements an AJAX interaction with an arbitrary answer provider, such as an external language model.

The actual calls to the language models are performed on the server. Currently, the plugin sends the requests to a (usually local) HTTP server that implements a simple API demonstrated in the examples below (change the host and port accordingly).

Requesting the list of answer providers

GET http://localhost:42774/list

Response:

{
    "providers": [
        "name of the first provider",
        "name of the second provider",
        "name of the third provider",
    ]   
}

Requesting an answer

POST http://localhost:42774/send
Content-Type: application/json

{
    "query": "the query",
    "answer_provider": "name of the requested provider"
}

Response:

{
    "text": "the answer",
    "interaction_id": "id_of_this_interaction"
}

Current implementations of answer providers

The repository [HarpIA Moodle - Answer Providers] contains an implementation of a few answer providers, such as:

  • GPT models (via OpenAI API);
  • constant utterances (for quick testing purposes).

Dependencies

  • Moodle ≥ 4.0.3.

Plugins that use this plugin

About

Moodle plugin that implements an interaction with a language model through a web service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages