Skip to content

Commit

Permalink
Tweak context prompt to avoid 'what language?' when language is the c…
Browse files Browse the repository at this point in the history
…ontext name.
  • Loading branch information
liffiton committed Sep 4, 2024
1 parent 9a7836b commit b12ef13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/codehelp/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ def _list_fmt(s: str) -> str:

def prompt_str(self) -> str:
""" Convert this context into a string to be used in an LLM prompt. """
# if nothing is provided but a name, use just that name by itself
if not self.tools and not self.details and not self.avoid:
return self.name

template = jinja_env_prompt.from_string("""\
<name>{{ name }}</name>
Context name: <name>{{ name }}</name>
{% if tools %}
Environment and tools: <tools>{{ tools }}</tools>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/codehelp/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ def get_topics(llm: LLMConfig, query_id: int) -> list[str]:
return []

messages = prompts.make_topics_prompt(
'', # TODO: put this back: query_row['context'],
query_row['code'],
query_row['error'],
query_row['issue'],
'', # TODO: put this back: query_row['context'],
responses['main']
)

Expand Down

0 comments on commit b12ef13

Please sign in to comment.