{
"id": "multi function plugin",
"schema_version": "v1",
"name_for_human": "multi function plugin",
"name_for_model": "multi function plugin",
"description_for_human": "Testing for multi function plugin",
"description_for_model": "Always use this plugin",
"auth": {
"type": "none"
},
"api": {
"type": "python",
"python": {
"source": "import json\nfrom pyodide.http import pyfetch\n\nasync def main():\n response = await chat(\n conversation=CURRENT_CONVERSATION + [\n {\n \"role\": \"system\",\n \"content\": \"Only use the functions you have been provided with.\"\n }\n ],\n functions=[\n {\n \"name\": \"summarization\",\n \"description\": \"summarize the conversation\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\",\n \"description\": \"the summary of the conversation\"\n }\n },\n \"required\": [\"summary\"]\n }\n },\n {\n \"name\": \"focal_points\",\n \"description\": \"extract the focal points of the conversation\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"points\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"extract the focal points of the conversation\"\n }\n }\n },\n \"required\": [\"points\"]\n }\n }\n ]\n )\n if 'function_call' in response:\n if response['function_call']['name'] == 'summarization':\n print(\"The summary of the converstaion is \", json.loads(response['function_call']['arguments'])['summary'])\n elif response['function_call']['name'] == 'focal_points':\n print(\"The focal points of the converstaion are \", json.loads(response['function_call']['arguments'])['points'])\n else:\n print(response['content'])\n\nawait main()"
}
}
} |