File size: 4,559 Bytes
de3c2ee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
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,
}
|