chore: document function types

This commit is contained in:
sigoden
2024-05-18 10:15:35 +00:00
parent 0e668ab3f2
commit be279dcd32
+19 -2
View File
@@ -53,8 +53,7 @@ AIChat will automatically load `functions.json` and execute functions located in
Now you can interact with your LLM using natural language prompts that trigger your defined functions. Now you can interact with your LLM using natural language prompts that trigger your defined functions.
![demo](https://github.com/sigoden/aichat/assets/4012553/9a5df031-530a-4679-acdd-c8f0c45d2bf7) ![image](https://github.com/sigoden/llm-functions/assets/4012553/867b7b2a-25fb-4c74-9b66-3701eaabbd1f)
## Writing Your Own Functions ## Writing Your Own Functions
@@ -86,6 +85,24 @@ The relationship between flags/options and parameters in function declarations i
**After creating your function, don't forget to rebuild the function declarations.** **After creating your function, don't forget to rebuild the function declarations.**
## Function Types
### Retrieve Type
The function returns JSON data to LLM for further processing.
AIChat does not ask permission to run the function or print the output.
### Execute Type
The function does not return data to LLM. Instead, they enable more complex actions, such as showing a progress bar or running a TUI application.
AIChat will ask permission before running the function.
![image](https://github.com/sigoden/aichat/assets/4012553/711067b8-dd23-443d-840a-5556697ab075)
**AIChat categorizes functions starting with `may_` as `execute type` and all others as `retrieve type`.**
## License ## License
The project is under the MIT License, Refer to the [LICENSE](https://github.com/sigoden/llm-functions/blob/main/LICENSE) file for detailed information. The project is under the MIT License, Refer to the [LICENSE](https://github.com/sigoden/llm-functions/blob/main/LICENSE) file for detailed information.