Skip to content

Commit 03af027

Browse files
[New Community Extension] Ollama AI (#1299)
Co-authored-by: Daveee19 <[email protected]>
1 parent fbb42fd commit 03af027

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

extensions/community/OllamaAI.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"author": "",
3+
"category": "Third-party",
4+
"extensionNamespace": "",
5+
"fullName": "OllamaAI",
6+
"helpPath": "",
7+
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNoYXQtcHJvY2Vzc2luZy1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTEyIDNDNi41IDMgMiA2LjU4IDIgMTFDMi4wNSAxMy4xNSAzLjA2IDE1LjE3IDQuNzUgMTYuNUM0Ljc1IDE3LjEgNC4zMyAxOC42NyAyIDIxQzQuMzcgMjAuODkgNi42NCAyMCA4LjQ3IDE4LjVDOS42MSAxOC44MyAxMC44MSAxOSAxMiAxOUMxNy41IDE5IDIyIDE1LjQyIDIyIDExUzE3LjUgMyAxMiAzTTEyIDE3QzcuNTggMTcgNCAxNC4zMSA0IDExUzcuNTggNSAxMiA1IDIwIDcuNjkgMjAgMTEgMTYuNDIgMTcgMTIgMTdNMTcgMTJWMTBIMTVWMTJIMTdNMTMgMTJWMTBIMTFWMTJIMTNNOSAxMlYxMEg3VjEySDlaIiAvPjwvc3ZnPg==",
8+
"name": "OllamaAI",
9+
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/17afc029e0ccfc314f5b7f5f53632ca24b3e6082d0cc87c0777dcfa79fd56e0b_chat-processing-outline.svg",
10+
"shortDescription": "This extension adds the functionality to your project to easily send requests to the \"Ollama\" AI, and get responses from it.",
11+
"version": "1.0.0",
12+
"description": [
13+
"Create a simple action to send the following data to a Ollama AI server:",
14+
"",
15+
"- URL (The server's URL with port)",
16+
"- Model (The model you want to generate the response)",
17+
"- Prompt (The prompt you send to the server to reply to)"
18+
],
19+
"tags": [
20+
"ollama",
21+
"ai",
22+
"llama",
23+
"llama2",
24+
"llama3",
25+
"chat",
26+
"bot"
27+
],
28+
"authorIds": [],
29+
"dependencies": [],
30+
"eventsFunctions": [
31+
{
32+
"description": "Sends the prompt string, the model string, and the stream boolean from the given structure.",
33+
"fullName": "Send prompt to a model",
34+
"functionType": "Action",
35+
"name": "Request",
36+
"sentence": "Send _PARAM2_ and _PARAM3_ to _PARAM1_, then store the response JSON in the variable \"Ollama_AI_JSON\"",
37+
"events": [
38+
{
39+
"type": "BuiltinCommonInstructions::Standard",
40+
"conditions": [],
41+
"actions": [
42+
{
43+
"type": {
44+
"value": "ModVarSceneTxt"
45+
},
46+
"parameters": [
47+
"Ollama_AI.model",
48+
"=",
49+
"Model"
50+
]
51+
},
52+
{
53+
"type": {
54+
"value": "ModVarSceneTxt"
55+
},
56+
"parameters": [
57+
"Ollama_AI.prompt",
58+
"=",
59+
"Prompt"
60+
]
61+
},
62+
{
63+
"type": {
64+
"value": "SetSceneVariableAsBoolean"
65+
},
66+
"parameters": [
67+
"Ollama_AI.stream",
68+
"False"
69+
]
70+
},
71+
{
72+
"type": {
73+
"value": "SendAsyncRequest"
74+
},
75+
"parameters": [
76+
"API_URL",
77+
"ToJSON(Ollama_AI)",
78+
"\"POST\"",
79+
"",
80+
"Ollama_AI_JSON",
81+
"Ollama_AI_Error"
82+
]
83+
}
84+
]
85+
}
86+
],
87+
"parameters": [
88+
{
89+
"description": "The URL where the Ollama model is hosted (e.g. http://localhost:11434/api/generate)",
90+
"longDescription": "The URL should be in this format: \"http://<ip address>:11434/api/generate\". If you are hosting and testing locally, use this URL: \"http://localhost:11434/api/generate\". Read the extension's GitHub issue on how to host your own server.",
91+
"name": "API_URL",
92+
"supplementaryInformation": "[\"http://localhost:11434/api/generate\"]",
93+
"type": "stringWithSelector"
94+
},
95+
{
96+
"description": "The model to be used when generating a response",
97+
"longDescription": "The recommended one is \"llama3\", an older version is \"llama2\", but you can also customize the models and use those. Read the extension's GitHub issue on how to do this.",
98+
"name": "Model",
99+
"supplementaryInformation": "[\"llama3\",\"llama2\",\"codegemma\"]",
100+
"type": "stringWithSelector"
101+
},
102+
{
103+
"description": "Your prompt to the AI, for example: \"Why is the sky blue?\"",
104+
"longDescription": "The response will be stored in JSON in the variable \"Ollama_AI_JSON\". After that, you can convert the JSON to a structure. You can see how you can do it in the example on the extension's GitHub.",
105+
"name": "Prompt",
106+
"type": "string"
107+
}
108+
],
109+
"objectGroups": []
110+
}
111+
],
112+
"eventsBasedBehaviors": [],
113+
"eventsBasedObjects": []
114+
}

0 commit comments

Comments
 (0)