textworld_prompt.py — langchain Source File
Architecture documentation for textworld_prompt.py, a python file in the langchain codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f481e8be_414f_a2d3_f944_2a8c7c2eb75b["textworld_prompt.py"] 4b3dcc0f_d872_0044_39ec_2d289f87f9e6["langchain_core.prompts.prompt"] f481e8be_414f_a2d3_f944_2a8c7c2eb75b --> 4b3dcc0f_d872_0044_39ec_2d289f87f9e6 style f481e8be_414f_a2d3_f944_2a8c7c2eb75b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from langchain_core.prompts.prompt import PromptTemplate
EXAMPLES = [
"""Setup: You are now playing a fast paced round of TextWorld! Here is your task for
today. First of all, you could, like, try to travel east. After that, take the
binder from the locker. With the binder, place the binder on the mantelpiece.
Alright, thanks!
-= Vault =-
You've just walked into a vault. You begin to take stock of what's here.
An open safe is here. What a letdown! The safe is empty! You make out a shelf.
But the thing hasn't got anything on it. What, you think everything in TextWorld
should have stuff on it?
You don't like doors? Why not try going east, that entranceway is unguarded.
Thought: I need to travel east
Action: Play[go east]
Observation: -= Office =-
You arrive in an office. An ordinary one.
You can make out a locker. The locker contains a binder. You see a case. The
case is empty, what a horrible day! You lean against the wall, inadvertently
pressing a secret button. The wall opens up to reveal a mantelpiece. You wonder
idly who left that here. The mantelpiece is standard. The mantelpiece appears to
be empty. If you haven't noticed it already, there seems to be something there
by the wall, it's a table. Unfortunately, there isn't a thing on it. Hm. Oh well
There is an exit to the west. Don't worry, it is unguarded.
Thought: I need to take the binder from the locker
Action: Play[take binder]
Observation: You take the binder from the locker.
Thought: I need to place the binder on the mantelpiece
Action: Play[put binder on mantelpiece]
Observation: You put the binder on the mantelpiece.
Your score has just gone up by one point.
*** The End ***
Thought: The End has occurred
Action: Finish[yes]
"""
]
SUFFIX = """\n\nSetup: {input}
{agent_scratchpad}"""
TEXTWORLD_PROMPT = PromptTemplate.from_examples(
EXAMPLES, SUFFIX, ["input", "agent_scratchpad"]
)
Dependencies
- langchain_core.prompts.prompt
Source
Frequently Asked Questions
What does textworld_prompt.py do?
textworld_prompt.py is a source file in the langchain codebase, written in python.
What does textworld_prompt.py depend on?
textworld_prompt.py imports 1 module(s): langchain_core.prompts.prompt.
Where is textworld_prompt.py in the architecture?
textworld_prompt.py is located at libs/langchain/langchain_classic/agents/react/textworld_prompt.py (directory: libs/langchain/langchain_classic/agents/react).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free