Skip to content

Commit

Permalink
fix: replace chat template with alternative roles (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuanjushi authored Jun 28, 2024
1 parent 1e94868 commit 6d54bdb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ jobs:
pip install hatch
- name: Build package
run: hatch build
- name: Clear GZ
run: |
find dist -name "pyopenagi-*.tar.gz" -delete
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion pyopenagi/agents/agent_config/CreationAgent.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "function",
"function": {
"name": "sdxl-turbo",
"description": "generate images by calling SDXL-turbo model",
"description": "generate images by calling sdxl-turbo model",
"parameters": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def run(self):
function_responses += function_response

self.messages.append({
"role": "user",
"content": f"It calls the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
"role": "assistant",
"content": f"I will call the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
})

self.logger.log(f"At current step, it will call the {function_name} with the params as {function_args}. The tool response is {function_responses}\n", level="info")
Expand All @@ -99,7 +99,7 @@ def run(self):

else:
self.messages.append({
"role": "user",
"role": "assistant",
"content": response_message
})
if i == len(self.workflow) - 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def run(self):


self.messages.append({
"role": "user",
"content": f"It calls the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
"role": "assistant",
"content": f"I will call the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
})

except Exception:
Expand All @@ -111,7 +111,7 @@ def run(self):

else:
self.messages.append({
"role": "user",
"role": "assistant",
"content": response_message
})
if i == len(self.workflow) - 1:
Expand Down
6 changes: 3 additions & 3 deletions pyopenagi/agents/native_agents/math_agent/math_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def run(self):
function_responses += function_response

self.messages.append({
"role": "user",
"content": f"It calls the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
"role": "assistant",
"content": f"I will call the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
})

self.logger.log(f"For current step, it will call the {function_name} with the params as {function_args}. The tool response is {function_responses}\n", level="info")
Expand All @@ -110,7 +110,7 @@ def run(self):

else:
self.messages.append({
"role": "user",
"role": "assistant",
"content": response_message
})

Expand Down
6 changes: 3 additions & 3 deletions pyopenagi/agents/native_agents/rec_agent/rec_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def run(self):
function_responses += function_response

self.messages.append({
"role": "user",
"content": f"It calls the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
"role": "assistant",
"content": f"I will call the {function_name} with the params as {function_args} to solve this. The tool response is {function_responses}\n"
})

self.logger.log(f"For current step, it will call the {function_name} with the params as {function_args}. The tool response is {function_responses}\n", level="info")
Expand All @@ -99,7 +99,7 @@ def run(self):

else:
self.messages.append({
"role": "user",
"role": "assistant",
"content": response_message
})

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = {file = "LICENSE"}
name = "pyopenagi"
readme = "README.md"
requires-python = ">=3.9"
version = "0.0.5"
version = "0.0.5.beta1"

classifiers = [
"Development Status :: 3 - Alpha",
Expand Down

0 comments on commit 6d54bdb

Please sign in to comment.