Skip to content

Commit

Permalink
Merge pull request modelscope#6 from FredericW/dev/as_copilot
Browse files Browse the repository at this point in the history
Multi-file loader support added
  • Loading branch information
ZiTao-Li authored Apr 26, 2024
2 parents ec3d8c0 + d7ae87c commit a55eaf0
Show file tree
Hide file tree
Showing 4 changed files with 368 additions and 222 deletions.
186 changes: 134 additions & 52 deletions examples/conversation_with_RAG_agents/configs/agent_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@
"model_config_name": "qwen_config",
"emb_model_config_name": "qwen_emb_config",
"rag_config": {
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../docs/sphinx_doc/en/source/tutorial",
"required_exts": [".md"]
"index_config": [
{
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../docs/sphinx_doc/en/source/tutorial",
"required_exts": [
".md"
]
}
}
}
}
},
],
"chunk_size": 2048,
"chunk_overlap": 40,
"similarity_top_k": 5,
Expand All @@ -37,41 +43,47 @@
"model_config_name": "qwen_config",
"emb_model_config_name": "qwen_emb_config",
"rag_config": {
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../src/agentscope",
"recursive": true,
"required_exts": [".py"]
}
}
},
"store_and_index": {
"transformations": [
{
"create_object": true,
"module": "llama_index.core.node_parser",
"class": "CodeSplitter",
"init_args": {
"language": "python",
"chunk_lines": 100
"index_config": [
{
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../src/agentscope",
"recursive": true,
"required_exts": [
".py"
]
}
}
},
"store_and_index": {
"transformations": [
{
"create_object": true,
"module": "llama_index.core.node_parser",
"class": "CodeSplitter",
"init_args": {
"language": "python",
"chunk_lines": 100
}
}
]
}
]
},
}
],
"chunk_size": 2048,
"chunk_overlap": 40,
"similarity_top_k": 5,
"log_retrieval": false,
"recent_n_mem": 1,
"persist_dir": "../../rag_storage/code_assist"
}
}
}
},
{
{
"class": "LlamaIndexAgent",
"args": {
"name": "API-Assistant",
Expand All @@ -80,35 +92,105 @@
"model_config_name": "qwen_config",
"emb_model_config_name": "qwen_emb_config",
"rag_config": {
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../docs/docstring_html/",
"required_exts": [".html"]
"index_config": [
{
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../docs/docstring_html/",
"required_exts": [
".html"
]
}
}
}
},
"chunk_size": 2048,
"chunk_overlap": 40,
"similarity_top_k": 3,
"log_retrieval": true,
"recent_n_mem": 1,
"persist_dir": "../../rag_storage/api_assist",
"repo_base": "../../"
}
}
],
"chunk_size": 2048,
"chunk_overlap": 40,
"similarity_top_k": 3,
"log_retrieval": true,
"recent_n_mem": 1,
"persist_dir": "../../rag_storage/api_assist",
"repo_base": "../../"
}
}
},
{
"class": "DialogAgent",
"args": {
"name": "Agent-Guiding-Assistant",
"description": "Agent-Guiding-Assistant is an agent that decide which agent should provide the answer next. It can answer questions about specific functions and classes in AgentScope.",
"sys_prompt": "You're an assistant guiding the user to specific agent for help. The answer is in a cheerful styled language. The output starts with appreciation for the question. Next, rephrase the question in a simple declarative Sentence for example, 'I think you are asking...'. Last, if the question is about detailed code or example in AgentScope Framework, output '@ Code-Search-Assistant you might be suitable for answering the question'; if the question is about API or function calls (Example: 'Is there function related...' or 'how can I initialize ...' ) in AgentScope, output '@ API-Assistant, I think you are more suitable for the question, please tell us more about it'; otherwise, output '@ Tutorial-Assistant, I think you are more suitable for the question, please tell us more about it'. The answer is expected to be one line only",
"sys_prompt": "You're an assistant guiding the user to specific agent for help. The answer is in a cheerful styled language. The output starts with appreciation for the question. Next, rephrase the question in a simple declarative Sentence for example, 'I think you are asking...'. Last, if the question is about detailed code or example in AgentScope Framework, output '@ Code-Search-Assistant you might be suitable for answering the question'; if the question is about API or function calls (Example: 'Is there function related...' or 'how can I initialize ...' ) in AgentScope, output '@ API-Assistant, I think you are more suitable for the question, please tell us more about it'; if question is about where to find some context (Example:'where can I find...'), output '@ Searching-Assistant, we need your help', otherwise, output '@ Tutorial-Assistant, I think you are more suitable for the question, can you tell us more about it?'. The answer is expected to be only one sentence",
"model_config_name": "qwen_config",
"use_memory": false
}
},
{
"class": "LlamaIndexAgent",
"args": {
"name": "Searching-Assistant",
"description": "Search-Assistant is an agent that can provide answer based on AgentScope code and tutorial. It can answer questions about everything in AgentScope codes and tutorials.",
"sys_prompt": "You're a helpful assistant of AgentScope. The answer starts with appreciation for the question, then provide output the location of the code or section that the most relevant to the question. The answer is limited to be less than 50 words.",
"model_config_name": "qwen_config",
"emb_model_config_name": "qwen_emb_config",
"rag_config": {
"index_config": [
{
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../docs/sphinx_doc/en/source/tutorial",
"required_exts": [
".md"
]
}
}
}
},
{
"load_data": {
"loader": {
"create_object": true,
"module": "llama_index.core",
"class": "SimpleDirectoryReader",
"init_args": {
"input_dir": "../../src/agentscope",
"recursive": true,
"required_exts": [
".py"
]
}
}
},
"store_and_index": {
"transformations": [
{
"create_object": true,
"module": "llama_index.core.node_parser",
"class": "CodeSplitter",
"init_args": {
"language": "python",
"chunk_lines": 100
}
}
]
}
}
],
"chunk_size": 2048,
"chunk_overlap": 40,
"similarity_top_k": 5,
"log_retrieval": false,
"recent_n_mem": 1,
"persist_dir": "../../rag_storage/searching_assist"
}
}
}
]
Loading

0 comments on commit a55eaf0

Please sign in to comment.