Ask-ANRG / openai_function_utils /openai_function_interface.py
FloraJ's picture
update model
de3c2ee
raw
history blame
4.56 kB
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, get_fuzz_name, semantic_search
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",
}
},
"required": ["name"],
},
},
{
"name": "get_fuzz_name",
"description": "When user mentions a name that is cannot be found, use this function to search for the most similar name.",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of a lab member",
}
},
"required": ["name"],
},
},
{
"name": "semantic_search",
"description": "does a semantic search over the documents based on query",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The query to search for",
}
},
"required": ["query"],
}
},
]
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,
"get_fuzz_name": get_fuzz_name,
"semantic_search": semantic_search,
}