Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement 3.2 3.3] COT, TOT strategy for engineer role #341

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LeonZh0u
Copy link
Contributor

WIP implemented COT, will push TOT if the current way of calling aask() makes sense

@LeonZh0u LeonZh0u marked this pull request as draft September 19, 2023 03:22

import asyncio

@pytest.mark.asyncio
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8

@@ -0,0 +1,29 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上合适的带作者的文件头

@@ -39,11 +41,20 @@ def __str__(self):
def __repr__(self):
return self.__str__()

async def _aask(self, prompt: str, system_msgs: Optional[list[str]] = None) -> str:
async def _aask(self, prompt: str, strategy: PromptStrategyType = None, task: Task = None, system_msgs: Optional[list[str]] = None) -> str:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用Optional装饰可能None的字段

task.task_args_pool[output_key] = await self._aask(PROMPT)
prompt = PROMPT
elif strategy == PromptStrategyType.TREE_OF_THOUGHT:
pass
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该要raise SomeException

@@ -0,0 +1,12 @@
from typing import Dict
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要合适的文件头

ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
-----
## Step by Step Implementation Plan: {filename}
"""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我比较建议如果是写代码,建议这里就直接让它写伪代码

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

并且在伪代码上加合适的注释,或者写多份伪代码

},
# an ordered list of prompt output keys
task_output_keys = ["plan", "code"])
code = await self.write_code('', strategy = strategy, task = task)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有处理TOT等其他状态

@stellaHSR stellaHSR added the enhancement New feature or request label Sep 26, 2023

for _ in max_num_rounds:
for prompt_template, step_output in zip(self.task.prompts, self.task.task_output_keys):
message = self.prompter.generate_initial_prompt(prompt_template, **self.task.task_args_pool)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is prompter? I think init first would be better

@@ -0,0 +1,31 @@
class ChainOfThoughtBase(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from abc import ABC
class ChainOfThoughtBase(ABC):

@geekan
Copy link
Owner

geekan commented Dec 21, 2023

Please resolve all conflicts and Review comments @LeonZh0u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants