Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
DavdGao committed Mar 15, 2024
1 parent d47dab6 commit 3d1d0f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions docs/sphinx_doc/en/source/tutorial/201-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ Below, we provide usages of how to configure various agents from the AgentPool:
def reply(self, x: dict = None) -> dict:
# Additional processing steps can occur here

if x is not None:
if not self.memory:
self.memory.add(x) # Update the memory with the input

# Generate a prompt for the language model using the system prompt and memory
prompt = self.engine.join(self.sys_prompt, self.memory.get_memory())
prompt = self.engine.join(
self.sys_prompt,
self.memory and self.memory.get_memory(),
)

# Invoke the language model with the prepared prompt
response = self.model(prompt).text
Expand Down
5 changes: 4 additions & 1 deletion docs/sphinx_doc/zh_CN/source/tutorial_zh/201-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def reply(self, x: dict = None) -> dict:
self.memory.add(x) # Update the memory with the input

# Generate a prompt for the language model using the system prompt and memory
prompt = self.engine.join(self.sys_prompt, self.memory.get_memory())
prompt = self.engine.join(
self.sys_prompt,
self.memory and self.memory.get_memory(),
)

# Invoke the language model with the prepared prompt
response = self.model(prompt).text
Expand Down
4 changes: 2 additions & 2 deletions src/agentscope/service/web_search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def bing_search(
Example:
.. code-block:: python
results = _search_bing(question="What is an agent?",
results = bing_search(question="What is an agent?",
bing_api_key="your bing api key",
num_results=2,
mkt="en-US")
Expand Down Expand Up @@ -150,7 +150,7 @@ def google_search(
Example:
.. code-block:: python
results = _search_google(
results = google_search(
'Python programming',
'your_google_api_key',
'your_cse_id',
Expand Down

0 comments on commit 3d1d0f7

Please sign in to comment.