ollama / ollama/ollama-python

answer seems to relate only to the system prompt, not to the actual prompt (user)

Open
#586 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

I don't understand what I am doing wrong, but it seems answer relates only to the System prompt, ignoring to actual prompt.

Can you help?

def get_completion(prompt: str, system_prompt="", prefill=""):
    response = chat(
        model=MODEL_NAME,
        options=Options(
            max_tokens=2000,
            temperature=0.0,
            num_ctx=8192, # I put context large enough for the txt file.
        ),
        messages=[
            {"role": "system", "content": system_prompt},  
            {"role": "user", "content": prompt},
            {"role": "assistant", "content": prefill}
            
        ],
        #think = True
        #format=ValueList.model_json_schema(),
    )
    return response.message.content

PROMPT = textwrap.dedent(f"""\

Input:
- Read the below <paper> and [prime the focus of the task].
- Pull the most relevant quotes into <scratchpad> tags, as evidences supporting the argument.

<paper>
    {content_doc} # here I inject the text from a large txt file
</paper>


Task:
- Answer the following <questions>, writing the answer for each in an <answer> tag.

<questions>
    <question>
        [..]. # sets of questions
    </question>

""")

SYSTEM_PROMPT = textwrap.dedent(f"""
You are a [Role] who [description of actions should take].
""")

PREFILL = ''


Answer:

I'd be happy to help analyze an argument. Please provide the text of [...].

Once I have the text, I'll proceed with the analysis.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the get_completion call with the shown system, user, and assistant messages, then inspect the request and returned message content. Verify whether the injected paper text and question reach the Ollama chat API; done means the response uses the user prompt rather than asking for text that was already supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.