Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Feat ChatGPT LLM Api Tools A.ka Function Calling #86

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

H0llyW00dzZ
Copy link
Owner

Ref Yidadaa#3217

Note : this just a experimental from my idea

[+] feat(openai.ts): add getFunctionCalling method to ChatGPTApi class
[+] feat(openai.ts): implement getFunctionCalling method to handle function calling customization
[+] feat(openai.ts): update chat method to use getFunctionCalling method
[+] feat(config.ts): add istools property to modelConfig in DEFAULT_CONFIG
[+] feat(config.ts): update version to 4.3 in useAppConfig migration
[+] feat(locales): add translations for FunctionCall component in cn, en, and id locales
[+] feat(settings.tsx): add import statement for Tool and useToolStore from "../store/tools"
[+] feat(constant.ts): add Tool enum value to FileName enum
[+] feat(constant.ts): add Tool enum value to StoreKey enum
[+] feat(store/tools.ts): create Tool, ToolParameter, ToolFunction interfaces
[+] feat(store/tools.ts): create SearchServicez object with methods for initializing, removing, adding, and searching tools
[+] feat(store/tools.ts): create useToolStore with methods for adding, getting, removing, updating, and searching tools
[+] feat(store/tools.ts): create persist store configuration for useToolStore with migration and rehydration logic
[+] feat(public/tools.json): add tools.json file with example tool data in English and Chinese languages
[+] chore(settings.tsx): fix import statement for ToolSearchService in settings.tsx
[+] fix(tools.ts): rename SearchServicez to ToolSearchService
[+] refactor(tools.ts): update references to SearchServicez to ToolSearchService
[+] refactor(tools.ts): update references to SearchServicez.builtinTools to ToolSearchService.builtinTools
[+] refactor(tools.ts): update references to SearchServicez.search to ToolSearchService.search
[+] refactor(tools.ts): update references to SearchServicez.count.builtin to ToolSearchService.count.builtin
[+] refactor(tools.ts): update references to SearchServicez.init to ToolSearchService.init
[+] refactor(tools.ts): Update Tool interface to include additional properties
[+] fix(tools.ts): Change parameter name in remove function from id to name
[+] feat(tools.ts): Add support for updating tools by id instead of name
[+] chore(tools.ts): Refactor initialization of ToolSearchService to include additional properties
[+] refactor(tools.ts): remove unused title and content properties from Tool interface
[+] feat(tools.ts): add type property to Tool interface
[+] refactor(tools.ts): update filter condition in useToolStore to check function name and description for search
[+] chore(tools.json): update tools.json with new structure and add support for unit parameter
 - Update the "type" field to "name" field
 - Add "type" field to the "parameters" object
 - Add "properties" field to the "parameters" object
 - Add "required" field to the "parameters" object
[+] chore(tools.ts): refactor ToolParameter interface to include optional properties, enum, and required fields
[+] feat(tools.ts): update useToolStore to include support for nested parameters in tool functions
[+] fix(tools.ts): fix bug in useToolStore where builtinTools were not being properly mapped
This reverts commit 481361c.

Reason : this correct
This reverts commit 57f88ae.

Reason : Old format is Deprecated
[+] fix(openai.ts): change tools from object to array in the payload
[+] fix(openai.ts): add required property for location in the tools payload
[+] fix(openai.ts): change modelConfig.model to defaultModel in getFunctionCalling function call
[+] fix(openai.ts): change modelConfig.istools to modelConfig.isTools in getFunctionCalling function call
[+] fix(openai.ts): add toolsPayload variable to getFunctionCalling function call
[+] fix(openai.ts): add toolsPayload to the magicPayload object
[+] fix(openai.ts): add comment explaining the bug in the code
[+] fix(tools.ts): add type assertion to the tool object in the map function
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant