Find answers from the community

Updated 2 months ago

Where to write a system prompt, when

Where to write a system prompt, when using Groq + Query engine?

Plain Text
@app.post("/query/")
def process_text(request_body: dict, db: Session = Depends(get_db)):
    query = request_body.get('query')
    vector_store = QdrantVectorStore(client=client, collection_name="data")
    index = VectorStoreIndex.from_vector_store(vector_store=vector_store)
    query_engine = index.as_query_engine()
    response = query_engine.query(query)
    return response.response


Where exactly do I need to plug my system prompt in the code above?
L
1 comment
In this case, you can set llm = Groq(..., system_prompt="Talk like a pirate in every response.")

You can also just customize the query engine prompt templates
Add a reply
Sign up and join the conversation on Discord