Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	test: insider
Browse files- requirements.txt +1 -1
- services/model_handler.py +57 -56
    	
        requirements.txt
    CHANGED
    
    | @@ -4,7 +4,7 @@ streamlit>=1.29.0 | |
| 4 | 
             
            accelerate>=0.26.0
         | 
| 5 | 
             
            arxiv>=1.4.7
         | 
| 6 | 
             
            python-dotenv>=1.0.0
         | 
| 7 | 
            -
            agno | 
| 8 | 
             
            ollama>=0.4.7
         | 
| 9 | 
             
            pypdf>=3.11.1
         | 
| 10 | 
             
            watchdog>=2.3.1
         | 
|  | |
| 4 | 
             
            accelerate>=0.26.0
         | 
| 5 | 
             
            arxiv>=1.4.7
         | 
| 6 | 
             
            python-dotenv>=1.0.0
         | 
| 7 | 
            +
            agno>=1.1.5
         | 
| 8 | 
             
            ollama>=0.4.7
         | 
| 9 | 
             
            pypdf>=3.11.1
         | 
| 10 | 
             
            watchdog>=2.3.1
         | 
    	
        services/model_handler.py
    CHANGED
    
    | @@ -30,84 +30,85 @@ class ModelHandler: | |
| 30 | 
             
                        name="Translator",
         | 
| 31 | 
             
                        role="You will translate the query to English",
         | 
| 32 | 
             
                        model=OpenAILike(
         | 
| 33 | 
            -
                            api_key=random.choice(API_KEYS),
         | 
| 34 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 35 | 
            -
                            id="moonshot-v1-8k"
         | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
                             | 
| 40 | 
            -
                         | 
| 41 | 
             
                    ) 
         | 
| 42 |  | 
| 43 | 
             
                    self.researcher = Agent(
         | 
| 44 | 
             
                        name="Researcher",
         | 
| 45 | 
             
                        role="You are a research scholar who specializes in autism research.",
         | 
| 46 | 
             
                        model=OpenAILike(
         | 
| 47 | 
            -
                            api_key=random.choice(API_KEYS),
         | 
| 48 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 49 | 
            -
                            id="moonshot-v1-8k"
         | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
                             | 
| 61 | 
            -
             | 
| 62 | 
            -
                         | 
| 63 | 
             
                    )
         | 
| 64 | 
             
                    self.summarizer = Agent(
         | 
| 65 | 
             
                        name="Summarizer",
         | 
| 66 | 
             
                        role="You are a specialist in summarizing research papers for people without autism knowledge.",
         | 
| 67 | 
             
                        model=OpenAILike(
         | 
| 68 | 
            -
                            api_key=random.choice(API_KEYS),
         | 
| 69 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 70 | 
            -
                            id="moonshot-v1-8k"
         | 
| 71 | 
            -
             | 
| 72 | 
            -
             | 
| 73 | 
            -
             | 
| 74 | 
            -
             | 
| 75 | 
            -
             | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
                             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
                         | 
| 89 | 
             
                    )
         | 
| 90 |  | 
| 91 | 
             
                    self.presenter = Agent(
         | 
| 92 | 
             
                        name="Presenter",
         | 
| 93 | 
             
                        role="You are a professional researcher who presents the results of the research.",
         | 
| 94 | 
             
                        model=OpenAILike(
         | 
| 95 | 
            -
                            api_key=random.choice(API_KEYS),
         | 
| 96 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 97 | 
            -
                            id="moonshot-v1-8k"
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 98 | 
             
                        ),
         | 
| 99 | 
            -
                        instructions=[
         | 
| 100 | 
            -
                            "You are multilingual",
         | 
| 101 | 
            -
                            "You must present the results in a clear and concise manner.",
         | 
| 102 | 
            -
                            "Clenaup the presentation to make it more readable.",
         | 
| 103 | 
            -
                            "Remove unnecessary information.",
         | 
| 104 | 
            -
                            "Remove everything related to the run itself like: 'Running: transfer_', just use plain text",
         | 
| 105 | 
            -
                            "You must use the language provided by the user to present the results.",
         | 
| 106 | 
            -
                            "Add references to the sources used in the answer.",
         | 
| 107 | 
            -
                            "Add emojis to make the presentation more interactive."
         | 
| 108 | 
            -
                            "Translaste the answer to Portuguese."
         | 
| 109 | 
            -
                        ],
         | 
| 110 | 
            -
                        add_references=True,
         | 
| 111 | 
             
                    )
         | 
| 112 |  | 
| 113 |  | 
|  | |
| 30 | 
             
                        name="Translator",
         | 
| 31 | 
             
                        role="You will translate the query to English",
         | 
| 32 | 
             
                        model=OpenAILike(
         | 
| 33 | 
            +
                            api_key=str(random.choice(API_KEYS)),
         | 
| 34 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 35 | 
            +
                            id="moonshot-v1-8k",
         | 
| 36 | 
            +
                            goal="Translate to English",
         | 
| 37 | 
            +
                            instructions=[
         | 
| 38 | 
            +
                                "Translate the query to English"
         | 
| 39 | 
            +
                            ]
         | 
| 40 | 
            +
                        )
         | 
| 41 | 
             
                    ) 
         | 
| 42 |  | 
| 43 | 
             
                    self.researcher = Agent(
         | 
| 44 | 
             
                        name="Researcher",
         | 
| 45 | 
             
                        role="You are a research scholar who specializes in autism research.",
         | 
| 46 | 
             
                        model=OpenAILike(
         | 
| 47 | 
            +
                            api_key=str(random.choice(API_KEYS)),
         | 
| 48 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 49 | 
            +
                            id="moonshot-v1-8k",
         | 
| 50 | 
            +
                            tools=[ArxivTools(), PubmedTools()],
         | 
| 51 | 
            +
                            instructions=[
         | 
| 52 | 
            +
                                "You have ArxivTools and PubmedTools at your disposal. Use them to find relevant papers for the question.",
         | 
| 53 | 
            +
                                "You need to understand the context of the question to provide the best answer based on your tools.",
         | 
| 54 | 
            +
                                "Be precise and provide just enough information to be useful.",
         | 
| 55 | 
            +
                                "You must cite the sources used in your answer.",
         | 
| 56 | 
            +
                                "You must create an accessible summary.",
         | 
| 57 | 
            +
                                "The content must be for people without autism knowledge.",
         | 
| 58 | 
            +
                                "Focus in the main findings of the paper taking in consideration the question.",
         | 
| 59 | 
            +
                                "The answer must be brief."
         | 
| 60 | 
            +
                            ],
         | 
| 61 | 
            +
                            show_tool_calls=True
         | 
| 62 | 
            +
                        )
         | 
| 63 | 
             
                    )
         | 
| 64 | 
             
                    self.summarizer = Agent(
         | 
| 65 | 
             
                        name="Summarizer",
         | 
| 66 | 
             
                        role="You are a specialist in summarizing research papers for people without autism knowledge.",
         | 
| 67 | 
             
                        model=OpenAILike(
         | 
| 68 | 
            +
                            api_key=str(random.choice(API_KEYS)),
         | 
| 69 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 70 | 
            +
                            id="moonshot-v1-8k",
         | 
| 71 | 
            +
                            instructions=[
         | 
| 72 | 
            +
                                "You must provide just enough information to be useful",
         | 
| 73 | 
            +
                                "You must cite the sources used in your answer.",
         | 
| 74 | 
            +
                                "You must be clear and concise.",
         | 
| 75 | 
            +
                                "You must create an accessible summary.",
         | 
| 76 | 
            +
                                "The content must be for people without autism knowledge.",
         | 
| 77 | 
            +
                                "Focus in the main findings of the paper taking in consideration the question.",
         | 
| 78 | 
            +
                                "The answer must be brief."
         | 
| 79 | 
            +
                                "Remove everything related to the run itself like: 'Running: transfer_', just use plain text",
         | 
| 80 | 
            +
                                "You must use the language provided by the user to present the results.",
         | 
| 81 | 
            +
                                "Add references to the sources used in the answer.",
         | 
| 82 | 
            +
                                "Add emojis to make the presentation more interactive."
         | 
| 83 | 
            +
                                "Translaste the answer to Portuguese."
         | 
| 84 | 
            +
                            ],
         | 
| 85 | 
            +
                            show_tool_calls=True,
         | 
| 86 | 
            +
                            markdown=True,
         | 
| 87 | 
            +
                            add_references=True,
         | 
| 88 | 
            +
                        )
         | 
| 89 | 
             
                    )
         | 
| 90 |  | 
| 91 | 
             
                    self.presenter = Agent(
         | 
| 92 | 
             
                        name="Presenter",
         | 
| 93 | 
             
                        role="You are a professional researcher who presents the results of the research.",
         | 
| 94 | 
             
                        model=OpenAILike(
         | 
| 95 | 
            +
                            api_key=str(random.choice(API_KEYS)),
         | 
| 96 | 
             
                            base_url="https://api.moonshot.cn/v1",
         | 
| 97 | 
            +
                            id="moonshot-v1-8k",
         | 
| 98 | 
            +
                            instructions=[
         | 
| 99 | 
            +
                                "You are multilingual",
         | 
| 100 | 
            +
                                "You must present the results in a clear and concise manner.",
         | 
| 101 | 
            +
                                "Clenaup the presentation to make it more readable.",
         | 
| 102 | 
            +
                                "Remove unnecessary information.",
         | 
| 103 | 
            +
                                "Remove everything related to the run itself like: 'Running: transfer_', just use plain text",
         | 
| 104 | 
            +
                                "You must use the language provided by the user to present the results.",
         | 
| 105 | 
            +
                                "Add references to the sources used in the answer.",
         | 
| 106 | 
            +
                                "Add emojis to make the presentation more interactive."
         | 
| 107 | 
            +
                                "Translaste the answer to Portuguese."
         | 
| 108 | 
            +
                            ],
         | 
| 109 | 
            +
                            add_references=True,
         | 
| 110 | 
            +
                            markdown=True,
         | 
| 111 | 
             
                        ),
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 112 | 
             
                    )
         | 
| 113 |  | 
| 114 |  | 
