refactor: several improvements (#856)

pull/861/head
sigoden 1 month ago committed by GitHub
parent 03193e3844
commit 8b3bd63c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -18,6 +18,8 @@ Your output format should include:
- **Examples**: Show a case of input and output that fits the scenario.
Your workflow should be:
1. **Analyze User Input**: Extract key information from user requests to determine design objectives.
2. **Conceive New Prompts**: Based on user needs, create prompts that meet requirements, with each part being professional and detailed.
3. **Generate Output**: Must only output the newly generated and optimized prompts, without explanation, and without wrapping it in markdown code block.
1. Extract key information from user requests to determine design objectives.
2. Based on user needs, create prompts that meet requirements, with each part being professional and detailed.
3. Must only output the newly generated and optimized prompts, without explanation, without wrapping it in markdown code block.
My first request is: __INPUT__

@ -607,8 +607,8 @@
supports_function_calling: true
- name: ernie-4.0-8k-preview
max_input_tokens: 8192
input_price: 16.8
output_price: 16.8
input_price: 5.6
output_price: 11.2
supports_function_calling: true
- name: ernie-3.5-8k-preview
max_input_tokens: 8192
@ -736,6 +736,11 @@
input_price: 7
output_price: 7
supports_function_calling: true
- name: glm-4-alltools
max_input_tokens: 2048
input_price: 14
output_price: 14
supports_function_calling: true
- name: glm-4-0520
max_input_tokens: 128000
input_price: 14
@ -746,11 +751,6 @@
input_price: 0.14
output_price: 0.14
supports_function_calling: true
- name: glm-4-alltools
max_input_tokens: 2048
input_price: 14
output_price: 14
supports_function_calling: true
- name: glm-4-flash
max_input_tokens: 128000
input_price: 0
@ -761,11 +761,6 @@
input_price: 1.4
output_price: 1.4
supports_vision: true
- name: glm-4v
max_input_tokens: 2048
input_price: 7
output_price: 7
supports_vision: true
- name: embedding-3
type: embedding
max_input_tokens: 8192
@ -855,10 +850,6 @@
- name: cohere-command-r
max_input_tokens: 128000
supports_function_calling: true
- name: phi-3-medium-128k-instruct
max_input_tokens: 128000
- name: phi-3-mini-128k-instruct
max_input_tokens: 128000
- name: cohere-embed-v3-english
type: embedding
max_tokens_per_chunk: 512
@ -869,6 +860,16 @@
max_tokens_per_chunk: 512
default_chunk_size: 1000
max_batch_size: 96
- name: ai21-jamba-1.5-large
max_input_tokens: 256000
supports_function_calling: true
- name: ai21-jamba-1.5-mini
max_input_tokens: 256000
supports_function_calling: true
- name: phi-3.5-mini-instruct
max_input_tokens: 128000
- name: phi-3-medium-128k-instruct
max_input_tokens: 128000
# Links:
# - https://deepinfra.com/models
@ -1313,7 +1314,7 @@
max_input_tokens: 8192
input_price: 0
output_price: 0
- name: deepseek-ai/DeepSeek-V2-Chat
- name: deepseek-ai/DeepSeek-V2.5
max_input_tokens: 32768
input_price: 0.186
output_price: 0.186
@ -1394,44 +1395,44 @@
models:
- name: jina-clip-v1
type: embedding
input_price: 0.02
input_price: 0
max_tokens_per_chunk: 8192
default_chunk_size: 1500
max_batch_size: 100
- name: jina-embeddings-v2-base-en
type: embedding
input_price: 0.02
input_price: 0
max_tokens_per_chunk: 8192
default_chunk_size: 1500
max_batch_size: 100
- name: jina-embeddings-v2-base-zh
type: embedding
input_price: 0.02
input_price: 0
max_tokens_per_chunk: 8192
default_chunk_size: 1500
max_batch_size: 100
- name: jina-colbert-v2
type: embedding
input_price: 0.02
input_price: 0
max_tokens_per_chunk: 8192
default_chunk_size: 1500
max_batch_size: 100
- name: jina-reranker-v2-base-multilingual
type: reranker
max_input_tokens: 1024
input_price: 0.02
input_price: 0
- name: jina-reranker-v1-turbo-en
type: reranker
max_input_tokens: 8192
input_price: 0.02
input_price: 0
- name: jina-reranker-v1-base-en
type: reranker
max_input_tokens: 8192
input_price: 0.02
input_price: 0
- name: jina-colbert-v2
type: reranker
max_input_tokens: 8192
input_price: 0.02
input_price: 0
# Links:
# - https://docs.voyageai.com/docs/embeddings

@ -241,25 +241,25 @@ async fn shell_execute(config: &GlobalConfig, shell: &Shell, mut input: Input) -
loop {
let answer = Select::new(
eval_str.trim(),
vec!["Execute", "Revise", "Explain", "Cancel"],
vec!["Execute", "🔄 Revise", "📖 Explain", "Cancel"],
)
.prompt()?;
match answer {
"Execute" => {
"Execute" => {
debug!("{} {:?}", shell.cmd, &[&shell.arg, &eval_str]);
let code = run_command(&shell.cmd, &[&shell.arg, &eval_str], None)?;
if code != 0 {
process::exit(code);
}
}
"Revise" => {
"🔄 Revise" => {
let revision = Text::new("Enter your revision:").prompt()?;
let text = format!("{}\n{revision}", input.text());
input.set_text(text);
return shell_execute(config, shell, input).await;
}
"Explain" => {
"📖 Explain" => {
let role = config.read().retrieve_role(EXPLAIN_SHELL_ROLE)?;
let input = Input::from_str(config, &eval_str, Some(role));
let abort = create_abort_signal();

Loading…
Cancel
Save