Fix some doc examples (#542)
This commit is contained in:
		
							parent
							
								
									64b99724db
								
							
						
					
					
						commit
						ec66b56550
					
				|  | @ -114,6 +114,7 @@ print(model(messages)) | |||
| This class lets you call any OpenAIServer compatible model. | ||||
| Here's how you can set it (you can customise the `api_base` url to point to another server): | ||||
| ```py | ||||
| import os | ||||
| from smolagents import OpenAIServerModel | ||||
| 
 | ||||
| model = OpenAIServerModel( | ||||
|  |  | |||
|  | @ -194,7 +194,7 @@ If above clarifications are not sufficient, you can change the system prompt. | |||
| Let's see how it works. For example, let us check the default system prompt for the [`CodeAgent`] (below version is shortened by skipping zero-shot examples). | ||||
| 
 | ||||
| ```python | ||||
| print(agent.system_prompt_template) | ||||
| print(agent.prompt_templates["system_prompt"]) | ||||
| ``` | ||||
| Here is what you get: | ||||
| ```text | ||||
|  |  | |||
|  | @ -146,6 +146,7 @@ print(model(messages)) | |||
| यह क्लास आपको किसी भी OpenAIServer कम्पैटिबल मॉडल को कॉल करने देती है। | ||||
| यहाँ बताया गया है कि आप इसे कैसे सेट कर सकते हैं (आप दूसरे सर्वर को पॉइंट करने के लिए `api_base` url को कस्टमाइज़ कर सकते हैं): | ||||
| ```py | ||||
| import os | ||||
| from smolagents import OpenAIServerModel | ||||
| 
 | ||||
| model = OpenAIServerModel( | ||||
|  |  | |||
|  | @ -195,7 +195,7 @@ Final answer: | |||
| आइए देखें कि यह कैसे काम करता है। उदाहरण के लिए, आइए [`CodeAgent`] के लिए डिफ़ॉल्ट सिस्टम प्रॉम्प्ट की जाँच करें (नीचे दिया गया वर्जन जीरो-शॉट उदाहरणों को छोड़कर छोटा किया गया है)। | ||||
| 
 | ||||
| ```python | ||||
| print(agent.system_prompt_template) | ||||
| print(agent.prompt_templates["system_prompt"]) | ||||
| ``` | ||||
| Here is what you get: | ||||
| ```text | ||||
|  |  | |||
|  | @ -193,7 +193,7 @@ Final answer: | |||
| 让我们看看它是如何工作的。例如,让我们检查 [`CodeAgent`] 的默认系统提示(下面的版本通过跳过零样本示例进行了缩短)。 | ||||
| 
 | ||||
| ```python | ||||
| print(agent.system_prompt_template) | ||||
| print(agent.prompt_templates["system_prompt"]) | ||||
| ``` | ||||
| 你会得到: | ||||
| ```text | ||||
|  |  | |||
|  | @ -45,7 +45,7 @@ class E2BExecutor: | |||
|             raise ModuleNotFoundError( | ||||
|                 """Please install 'e2b' extra to use E2BExecutor: `pip install "smolagents[e2b]"`""" | ||||
|             ) | ||||
| 
 | ||||
|         self.logger = logger | ||||
|         self.logger.log("Initializing E2B executor, hold on...") | ||||
| 
 | ||||
|         self.custom_tools = {} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue