from openai_function_utils.openai_function_impl import get_lab_member_info, get_pub_info, get_lab_member_detailed_info, \ get_publication_by_year, get_pub_by_name, semantic_search, search_downloads, get_member_list_by_edu_status OPENAI_FUNCTIONS_DEFINITIONS = [ { "name": "get_lab_member_info", "description": "Get name, photo url, links such as LinkedIn and GitHub, and description of a member of a lab by name. This function is helpful when asked about a name, such as Bhaskar Krishnamachari.", "parameters": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of a lab member, e.g. Jared Coleman", } }, "required": ["name"], }, }, { "name": "get_lab_member_detailed_info", "description": "This function is helpful when asked about the specific information of a lab member, such as what is the position or photo or related link of Bhaskar Krishnamachari.", "parameters": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of a lab member, e.g. Jared Coleman", }, "detailed_info": { "type": "string", "description": "category of the information that the user want to ask about, e.g. position, title, homepage, link", } }, "required": ["name", "detailed_info"], }, }, { "name": "get_publication_by_year", "description": "This function is helpful in finding all publication information given a specific year, e.g. what are the 2023 publications.", "parameters": { "type": "object", "properties": { "year": { "type": "string", "description": "The year of the publication, e.g. 2023", } }, "required": ["year"], }, }, { "name": "get_pub_info", "description": "Get title, venue, authors, year and link to the publication articles by the title of the publication. This is helpful when asked about a publication, such as when \"Search and Rescue on the Line\" is published, or what publications are made in 2023. When input contains \"\", it's probably a publication", "parameters": { "type": "object", "properties": { "name": { "type": "string", "description": "Title of the publication, e.g. Search and Rescue on the Line\"", } }, "required": ["name"], }, }, { "name": "get_pub_by_name", "description": "Get information (e.g. title, venue, authors, year and link to the publication articles) of all publications written by name of a specific member of the lab.", "parameters": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of a lab member, for example, Jared Coleman, J Coleman", } }, "required": ["name"], }, }, { "name": "semantic_search", "description": "The function performs a semantic search over the documents based on query. Specifically, it will retrieve related documents with the maximum cosine similarity between the embedding of the query with that of all database documents.", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The query to search for", } }, "required": ["query"], } }, { "name": "search_downloads", "description": "This function returns information (including info such as textual description, link to code and dataset, etc.) of video demos, code and datasets, and course materials based on the title of the video/code/dataset/course.", "parameters": { "type": "object", "properties": { "input_title": { "type": "string", "description": "Title of things such as video demos, code, datasets, and course materials to search for.", } }, "required": ["input_title"], } }, { "name": "get_member_list_by_edu_status", "description": "Get list of member info by education level and status (whether still in the lab), which are indicated in the name of the choice that you will be choosing from.", "parameters": { "type": "object", "properties": { "criterion": { "type": "string", "description": "Choice of education and his/her status. e.g.: former_postdoc means people pursuing postdoc but have already graduated from and left the lab.", "enum": ['undergrad', 'current_phd', 'director', 'former_postdoc', 'former_visiting', 'graduated', 'master'] } }, "required": ["criterion"], } }, ] OPENAI_AVAILABLE_FUNCTIONS = { "get_lab_member_info": get_lab_member_info, "get_pub_info": get_pub_info, "get_lab_member_detailed_info": get_lab_member_detailed_info, "get_publication_by_year": get_publication_by_year, "get_pub_by_name": get_pub_by_name, "semantic_search": semantic_search, "search_downloads": search_downloads, "get_member_list_by_edu_status": get_member_list_by_edu_status }