| 5 | |
| 6 | class Environment: |
| 7 | def __init__( |
| 8 | self, |
| 9 | use_model_name='QwQ-32B', |
| 10 | aux_model_name='Qwen2.5-72B-Instruct', |
| 11 | max_search_limit=15, |
| 12 | max_tokens=32768, |
| 13 | temperature=0.7, |
| 14 | top_p=0.8, |
| 15 | repetition_penalty=1.05, |
| 16 | top_k=20, |
| 17 | min_p=0.05, |
| 18 | search_num=10, |
| 19 | max_interation_times=10, |
| 20 | max_path_tokens=20000, |
| 21 | api_base_url="", |
| 22 | aux_api_base_url='', |
| 23 | bing_subscription_key="", |
| 24 | bing_endpoint="https://api.bing.microsoft.com/v7.0/search", |
| 25 | lora_name=None, |
| 26 | lora_path=None, |
| 27 | use_jina=False, |
| 28 | jina_api_key=None, |
| 29 | keep_links=True, |
| 30 | ): |
| 31 | |
| 32 | self.use_model_name = use_model_name |
| 33 | self.aux_model_name = aux_model_name |
| 34 | self.max_search_limit = max_search_limit |
| 35 | self.jina_api_key = jina_api_key |
| 36 | self.use_jina = use_jina |
| 37 | self.max_tokens = max_tokens |
| 38 | self.temperature = temperature |
| 39 | self.top_p = top_p |
| 40 | self.repetition_penalty = repetition_penalty |
| 41 | self.top_k = top_k |
| 42 | self.min_p = min_p |
| 43 | self.search_num = search_num |
| 44 | self.max_path_tokens = max_path_tokens |
| 45 | self.max_interation_times = max_interation_times |
| 46 | self.start_time = time.time() |
| 47 | self.bing_subscription_key = bing_subscription_key |
| 48 | self.bing_endpoint = bing_endpoint |
| 49 | self.keep_links = keep_links |
| 50 | self.search_cache = {} |
| 51 | self.url_cache = {} |
| 52 | self.api_base_url = api_base_url |
| 53 | self.aux_api_base_url = aux_api_base_url |
| 54 | self.lora_name = lora_name |
| 55 | self.lora_path = lora_path |
| 56 | |
| 57 | self.error_indicators = [ |
| 58 | 'limit exceeded', |
| 59 | 'Error fetching', |
| 60 | 'Account balance not enough', |
| 61 | 'Invalid bearer token', |
| 62 | 'HTTP error occurred', |
| 63 | 'Error: Connection error occurred', |
| 64 | 'Error: Request timed out', |