-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function call feature, implement autonomous judgment on whether t…
…o search using function call, restructure code directory, add search command to enforce search.
- Loading branch information
Showing
16 changed files
with
194 additions
and
51 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ jobs: | |
uses: actions/checkout@v2 | ||
- name: Deploy | ||
run: | | ||
sh ./deploy.sh | ||
sh ./.github/deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
my_list = [ | ||
{"role": "admin", "content": "This is admin content."}, | ||
{"role": "user", "content": "This is user content."} | ||
] | ||
# my_list = [ | ||
# {"role": "admin", "content": "This is admin content."}, | ||
# {"role": "user", "content": "This is user content."} | ||
# ] | ||
a = {"role": "admin"} | ||
b = {"content": "This is user content."} | ||
a.update(b) | ||
print(a) | ||
|
||
content_list = [item["content"] for item in my_list] | ||
print(content_list) | ||
# content_list = [item["content"] for item in my_list] | ||
# print(content_list) | ||
|
||
engine = "gpt-3.5-turbo-1106" | ||
truncate_limit = ( | ||
30500 | ||
if "gpt-4-32k" in engine | ||
else 6500 | ||
if "gpt-4" in engine | ||
else 14500 | ||
if "gpt-3.5-turbo-16k" in engine or "gpt-3.5-turbo-1106" in engine | ||
else 98500 | ||
if ("claude-2-web" or "claude-2") in engine | ||
else 3400 | ||
) | ||
# engine = "gpt-3.5-turbo-1106" | ||
# truncate_limit = ( | ||
# 30500 | ||
# if "gpt-4-32k" in engine | ||
# else 6500 | ||
# if "gpt-4" in engine | ||
# else 14500 | ||
# if "gpt-3.5-turbo-16k" in engine or "gpt-3.5-turbo-1106" in engine | ||
# else 98500 | ||
# if ("claude-2-web" or "claude-2") in engine | ||
# else 3400 | ||
# ) | ||
|
||
print(truncate_limit) | ||
# print(truncate_limit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function_call_list = { | ||
"current_weather": { | ||
"functions": [ | ||
{ | ||
"name": "get_current_weather", | ||
"description": "Get the current weather in a given location", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"location": { | ||
"type": "string", | ||
"description": "The city and state, e.g. San Francisco, CA" | ||
}, | ||
"unit": { | ||
"type": "string", | ||
"enum": ["celsius", "fahrenheit"] | ||
} | ||
}, | ||
"required": ["location"] | ||
} | ||
} | ||
], | ||
"function_call": "auto" | ||
}, | ||
"web_search": { | ||
"functions": [ | ||
{ | ||
"name": "get_web_search_results", | ||
"description": "Search Google to enhance knowledge.", | ||
"parameters": { | ||
"type": "object", | ||
"properties": { | ||
"prompt": { | ||
"type": "string", | ||
"description": "The prompt to search." | ||
} | ||
}, | ||
"required": ["prompt"] | ||
} | ||
} | ||
], | ||
"function_call": "auto" | ||
}, | ||
# "web_search": { | ||
# "functions": [ | ||
# { | ||
# "name": "get_web_search_results", | ||
# "description": "Get the web page search results in a given keywords", | ||
# "parameters": { | ||
# "type": "object", | ||
# "properties": { | ||
# "keywords": { | ||
# "type": "string", | ||
# "description": "keywords that can yield better search results, keywords are connected with spaces, e.g. 1. The keywords of the sentence (How much does the zeabur software service cost per month?) is (zeabur price). 2. The keywords of the sentence (今天的微博热搜有哪些?) is (微博 热搜)" | ||
# } | ||
# }, | ||
# "required": ["keywords"] | ||
# } | ||
# } | ||
# ], | ||
# "function_call": "auto" | ||
# }, | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.