LangSmith/client/Client/pull_prompt/include_model
Properties
- tags
- @Langchain, @langsmith-py-sdk, @langsmith
Client.pull_prompt() — 🦜️🛠️ LangSmith documentation
pull_prompt(prompt_identifier: str, *, include_model: bool | None = False) → AnyOverview
Parameters
Model Identification Implications
Relationship to LangSmith PromptHub
Structured Output Applications
Optimizing for Structured Responses
Example with Structured Output
- python
from langsmith import Client client = Client() # Pull a prompt designed for structured JSON output with its model structured_chain = client.pull_prompt("json-extractor", include_model=True) # The model is already configured with the right parameters for structured output # such as response_format={"type": "json_object"} for OpenAI models result = structured_chain.invoke({"text": "Extract entities from this text..."}) # result will be properly structured according to the prompt's design
Best Practices
Related Methods