Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: push_prompt() seems not to be supported tagging #1461

Open
TakumaKurosawa opened this issue Jan 24, 2025 · 1 comment
Open

DOC: push_prompt() seems not to be supported tagging #1461

TakumaKurosawa opened this issue Jan 24, 2025 · 1 comment

Comments

@TakumaKurosawa
Copy link

Issue with current documentation:

Idea or request for content:

I've tried to manage the system prompts programatically as below code.

push_system_prompt.py

if __name__ == "__main__":
    version = os.getenv("VERSION")
    commit_sha = os.getenv("COMMIT_SHA")
    tags = [version, commit_sha]

    prompts: dict[str, ChatPromptTemplate] = {
        "multi-agent-primary-assistant-prompt": ChatPromptTemplate.from_messages(
            [
                SystemMessagePromptTemplate.from_template(
                    MULTI_AGENT_PRIMARY_ASSISTANT_PROMPT
                ),
                HumanMessagePromptTemplate.from_template("{user_input}"),
                MessagesPlaceholder("history"),
            ]
        ),
        # other prompts...
    }

    def push_prompt(
        name: str, prompt: ChatPromptTemplate, tags: list[str] | None
    ) -> None:
        try:
            langsmith_client.push_prompt(
                name,
                object=prompt,
                tags=tags,
            )
        except LangSmithConflictError:
            print(f"{name} is not changed")

    with futures.ThreadPoolExecutor() as executor:
        tasks = [
            executor.submit(push_prompt, name, prompt, tags)
            for name, prompt in prompts.items()
        ]
        futures.wait(tasks)

The problem is tags doesn't seem to set on new commit.

Image

I expected to set tags like below image.

Image

Are you sure to support tagging for each commits by push_system(tags=tags)?
If so, could you tell me how to do that? 🙏

@TakumaKurosawa TakumaKurosawa changed the title DOC: push_prompt() seems not to support the tagging DOC: push_prompt() seems not to be supported the tagging Jan 24, 2025
@TakumaKurosawa TakumaKurosawa changed the title DOC: push_prompt() seems not to be supported the tagging DOC: push_prompt() seems not to be supported tagging Jan 24, 2025
@TakumaKurosawa
Copy link
Author

I wonder Use Cases shows my tags 🤔
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant