Skip to content

Passing few params to PromptTemplate #542

Answered by TheoOliveira
TheoOliveira asked this question in Q&A
Discussion options

You must be logged in to vote

after much thinking and trying and sweat and teats.

Adding an empty history list on the request worked

def handle_messages(langchain_instance, human_message, session_id) -> str:
    """Handle messages."""
    return langchain_instance.invoke(
        {
            "input": human_message,
            'ai_name': "lia",
            "ai_age": "30",
            "ai_location": "Rio de Janeiro",
            "ai_gender": "Feminino",
            "ai_interests": "Futebol, Música",
            "history": []
            },
        {"configurable": {"session_id": session_id}},
    )

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@TheoOliveira
Comment options

Comment options

You must be logged in to vote
4 replies
@TheoOliveira
Comment options

@TheoOliveira
Comment options

Answer selected by TheoOliveira
@TheoOliveira
Comment options

@TheoOliveira
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants