fix some prompts

This commit is contained in:
LeonOstrez
2024-12-16 21:42:14 +01:00
parent 2a2760adc6
commit 60112e2efb
4 changed files with 10 additions and 5 deletions

View File

@@ -105,9 +105,14 @@ class SpecWriter(BaseAgent):
return AgentResponse.done(self)
async def check_prompt_complexity(self, prompt: str) -> str:
is_feature = self.current_state.epics and len(self.current_state.epics) > 2
await self.send_message("Checking the complexity of the prompt ...")
llm = self.get_llm(SPEC_WRITER_AGENT_NAME)
convo = AgentConvo(self).template("prompt_complexity", prompt=prompt)
convo = AgentConvo(self).template(
"prompt_complexity",
prompt=prompt,
is_feature=is_feature,
)
llm_response: str = await llm(convo, temperature=0, parser=StringParser())
log.info(f"Complexity check response: {llm_response}")
return llm_response.lower()

View File

@@ -469,4 +469,4 @@ class ProjectState(Base):
:return: True if the current epic is a feature, False otherwise.
"""
return self.epics and self.current_epic.get("source") == "feature"
return self.epics and self.current_epic and self.current_epic.get("source") == "feature"

View File

@@ -13,7 +13,7 @@ IMPORTANT:
- Do not repeat actions that you have already done. For example if you already added "index.js" to the list of relevant files you must not add it again.
- You must read the file before adding it to the list of relevant files. Do not add that you didn't read and see the content of the file.
- Focus only on your current task `{{ state.current_task.description }}` when selecting relevant files.
- IMPORTANT: You must read and add relevant files from both "client/" and "server/" folders so that implementation can be done correctly! The "client" and "server" must work seamlessly together!
{% if not state.has_frontend() %}- IMPORTANT: You must read and add relevant files from both "client/" and "server/" folders so that implementation can be done correctly! The "client" and "server" must work seamlessly together!{% endif %}
- IMPORTANT: Execute only 1 action per request! Once your response is processed you will be able to choose next action.
- IMPORTANT: It is much better to read and add more files than not adding files that are relevant!
- You can read and add up to 20 files at once and if you need to see more file contents you can do that in next iterations. Make sure you don't miss any files that are relevant!

View File

@@ -1,4 +1,4 @@
{% if state.is_feature() %}
{% if is_feature %}
Here is the app description that is fully built already:
```
{{ state.specification.description }}
@@ -9,7 +9,7 @@ Now I will show you the feature description that needs to be added to the app:
{{ prompt }}
```
{% if not state.is_feature() %}The above is a user prompt for application/software tool they are trying to develop. {% endif %}Determine the complexity of the user's request. Do NOT respond with thoughts, reasoning, explanations or anything similar, return ONLY a string representation of the complexity level. Use the following scale:
{% if not is_feature %}The above is a user prompt for application/software tool they are trying to develop. {% endif %}Determine the complexity of the user's request. Do NOT respond with thoughts, reasoning, explanations or anything similar, return ONLY a string representation of the complexity level. Use the following scale:
"hard" for high complexity
"moderate" for moderate complexity
"simple" for low complexity