id
stringlengths
14
15
text
stringlengths
27
2.12k
source
stringlengths
49
118
a22db2b26326-4
retrieversCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/chains/additional/multi_prompt_router
229ad3361e96-0
OpenAPI chain | ЁЯжЬя╕ПЁЯФЧ Langchain
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-1
Skip to main contentЁЯжЬя╕ПЁЯФЧ LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/тАЛOData connectionChainsHow toFoundationalDocumentsPopularAdditionalAnalyze DocumentSelf-critique chain with constitutional AICausal program-aided language (CPAL) cha...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-2
Attempting to load an OpenAPI 3.0.1 spec. This may result in degraded performance. Convert your OpenAPI spec to 3.1.* spec for better support.# Alternative loading from file# spec = OpenAPISpec.from_file("openai_openapi.yaml")Select the OperationтАЛIn order to provide a focused on modular chain, we create a chain spec...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-3
find the products the user is looking for. If the user explicitly stated what they want, use that as a query. The query is as specific as possible to the product name or category mentioned by the user in its singular form, and don't contain any clarifiers like latest, newest, cheapest, budget, premium, expensive or sim...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-4
The block must be no more than 1 line long, and all arguments must be valid JSON. All string arguments must be wrapped in double quotes. You MUST strictly comply to the types indicated by the provided schema, including all required args. If you don't have sufficient information to call the function due to thi...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-5
resulted in: API_RESPONSE: {"products":[{"name":"Burberry Check Poplin Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3201810981/Clothing/Burberry-Check-Poplin-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$360.00","attributes":["Material:Cotton","Target Group:Man","Color:Gray,Blue,Beige","P...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-6
null}', 'response_text': '{"products":[{"name":"Burberry Check Poplin Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3201810981/Clothing/Burberry-Check-Poplin-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$360.00","attributes":["Material:Cotton","Target Group:Man","Color:Gray,Blue,Beige","P...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-7
by the user in its singular form, and don't contain any clarifiers like latest, newest, cheapest, budget, premium, expensive or similar. The query is always taken from the latest topic, if there is a new topic a new query is started. */ q: string, /* number of products returned */ size?: number...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-8
the types indicated by the provided schema, including all required args. If you don't have sufficient information to call the function due to things like requiring specific uuid's, you can reply with the following message: Message: ```text Concise response requesting the additional information that wou...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-9
Vintage Check Stretch Cotton Twill Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3202342515/Clothing/Burberry-Vintage-Check-Stretch-Cotton-Twill-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$309.99","attributes":["Material:Elastane/Lycra/Spandex,Cotton","Target Group:Woman","Color:Beige","Pro...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-10
shirt?', 'output': '{"products":[{"name":"Burberry Check Poplin Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3201810981/Clothing/Burberry-Check-Poplin-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$360.00","attributes":["Material:Cotton","Target Group:Man","Color:Gray,Blue,Beige","Propert...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-11
Group:Man","Color:Beige"]},{"name":"Magellan Outdoors Laguna Madre Solid Short Sleeve Fishing Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3203102142/Clothing/Magellan-Outdoors-Laguna-Madre-Solid-Short-Sleeve-Fishing-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$19.99","attributes":["Materia...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-12
Vintage Check Stretch Cotton Twill Shirt","url":"https://www.klarna.com/us/shopping/pl/cl10001/3202342515/Clothing/Burberry-Vintage-Check-Stretch-Cotton-Twill-Shirt/?utm_source=openai&ref-site=openai_plugin","price":"$309.99","attributes":["Material:Elastane/Lycra/Spandex,Cotton","Target Group:Woman","Color:Beige","Pro...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-13
OpenAPI spec to 3.1.* spec for better support. Attempting to load an OpenAPI 3.0.1 spec. This may result in degraded performance. Convert your OpenAPI spec to 3.1.* spec for better support.operation = APIOperation.from_openapi_spec( spec, "/v1/public/openai/explain-task", "post")llm = OpenAI()chain = OpenAPIEndp...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-14
user asked their question in. Always use the full name of the language (e.g. Spanish, French). */ native_language?: string, /* A description of any additional context in the user's question that could affect the explanation - e.g. setting, scenario, situation, tone, speaking style and formality, usage notes, or...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-15
ARGS: > Finished chain. {"task_description": "ask for more tea", "learning_language": "Hindi", "native_language": "English", "full_query": "How would I ask for more tea in Delhi?"} {"explanation":"<what-to-say language=\"Hindi\" context=\"None\">\nрдФрд░ рдЪрд╛рдп рд▓рд╛рдУред (Aur chai lao.) \n</what-...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-16
рдкреАрдиреА рдЪрд╛рд╣рд┐рдПред\" *(Mujhe mehsoos ho raha hai ki mujhe kuch anya prakar ki chai peeni chahiye. - Formal, indicating a desire for a different type of tea)*\n3. \"рдХреНрдпрд╛ рдореБрдЭреЗ or cup рдореЗрдВ milk/tea powder рдорд┐рд▓ рд╕рдХрддрд╛ рд╣реИ?\" *(Kya mujhe aur cup mein milk/tea powder mil sakta ...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-17
рдЪрд╛рдп рдХреА рдорд╛рддреНрд░рд╛ рдореЗрдВ рднреА рдереЛрдбрд╝рд╛ рд╕рд╛ рдЗрдЬрд╛рдлрд╛ рдХрд░рдирд╛ред (Haan,bilkul. Aur chai ki matra mein bhi thoda sa eejafa karna. - Yes, please. And add a little extra in the quantity of tea as well.)\n</example-convo>\n\n*[Report an issue or leave feedback](https://speak.com/c...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-18
рдереЛрдбрд╝реА рдЬреНрдпрд╛рджрд╛ рдорд┐рд▓ рд╕рдХрддреА рд╣реИ?\" *(Chai thodi zyada mil sakti hai? - Polite, asking if more tea is available)*\n2. \"рдореБрдЭреЗ рдорд╣рд╕реВрд╕ рд╣реЛ рд░рд╣рд╛ рд╣реИ рдХрд┐ рдореБрдЭреЗ рдХреБрдЫ рдЕрдиреНрдп рдкреНрд░рдХрд╛рд░ рдХреА рдЪрд╛рдп рдкреАрдиреА рдЪрд╛рд╣рд┐рдПред\" *(...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-19
*(Kya mujhe aur cup mein milk/tea powder mil sakta hai? - Very informal/casual tone, asking for an extra serving of milk or tea powder)*\n</alternatives>\n\n<usage-notes>\nIn India and Indian culture, serving guests with food and beverages holds great importance in hospitality. You will find people always offering drin...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-20
of tea as well.)\n</example-convo>\n\n*[Report an issue or leave feedback](https://speak.com/chatgpt?rid=d4mcapbkopo164pqpbk321oc})*","extra_response_instructions":"Use all information in the API response and fully render all Markdown.\nAlways end your response with a link to report an issue or leave feedback on the pl...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-21
language=\\"Hindi\\" context=\\"None\\">\\nрдФрд░ рдЪрд╛рдп рд▓рд╛рдУред (Aur chai lao.) \\n</what-to-say>\\n\\n<alternatives context=\\"None\\">\\n1. \\"рдЪрд╛рдп рдереЛрдбрд╝реА рдЬреНрдпрд╛рджрд╛ рдорд┐рд▓ рд╕рдХрддреА рд╣реИ?\\" *(Chai thodi zyada mil sakti hai? - Polite, asking if more tea is available)*\\n2. \\"р...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-22
- Formal, indicating a desire for a different type of tea)*\\n3. \\"рдХреНрдпрд╛ рдореБрдЭреЗ or cup рдореЗрдВ milk/tea powder рдорд┐рд▓ рд╕рдХрддрд╛ рд╣реИ?\\" *(Kya mujhe aur cup mein milk/tea powder mil sakta hai? - Very informal/casual tone, asking for an extra serving of milk or tea powder)*\\n</alternatives>\\n\\...
https://python.langchain.com/docs/modules/chains/additional/openapi
229ad3361e96-23
рд╕рд╛ рдЗрдЬрд╛рдлрд╛ рдХрд░рдирд╛ред (Haan,bilkul. Aur chai ki matra mein bhi thoda sa eejafa karna. - Yes, please. And add a little extra in the quantity of tea as well.)\\n</example-convo>\\n\\n*[Report an issue or leave feedback](https://speak.com/chatgpt?rid=d4mcapbkopo164pqpbk321oc})*","extra_response_instructio...
https://python.langchain.com/docs/modules/chains/additional/openapi
e549b7b1efa5-0
Elasticsearch database | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database
e549b7b1efa5-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OData connectionChainsHow toFoundationalDocumentsPopularAdditionalAnalyze DocumentSelf-critique chain with constitutional AICausal program-aided language (CPAL) cha...
https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database
e549b7b1efa5-2
= "https://elastic:pass@localhost:9200"db = Elasticsearch(ELASTIC_SEARCH_SERVER)Uncomment the next cell to initially populate your db.# customers = [# {"firstname": "Jennifer", "lastname": "Walters"},# {"firstname": "Monica","lastname":"Rambeau"},# {"firstname": "Carol","lastname":"Danvers"},# {"firstna...
https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database
e549b7b1efa5-3
'customers', '_id': '1', '_score': 1.0, '_source': {'firstname': 'Monica'}}, {'_index': 'customers', '_id': '2', '_score': 1.0, '_source': {'firstname': 'Carol'}}, {'_index': 'customers', '_id': '3', '_score': 1.0, '_source': {'firstname': 'Wanda'}}, {'_index': 'customers', '_id': '4', '_score': 1.0, '_source': {'first...
https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database
e549b7b1efa5-4
which column is in which index. Return the query as valid json.Use the following format:Question: Question hereESQuery: Elasticsearch Query formatted as json"""PROMPT = PromptTemplate.from_template( PROMPT_TEMPLATE,)chain = ElasticsearchDatabaseChain.from_llm(llm=llm, database=db, query_prompt=PROMPT)Adding example ...
https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database
38c552f5de99-0
Model I/O | 🦜�🔗 Langchain Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcosystemAdditional resourcesModu...
https://python.langchain.com/docs/modules/model_io/
d110fc87e9d9-0
Output parsers | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/
d110fc87e9d9-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/
d110fc87e9d9-2
Listmodel_name = 'text-davinci-003'temperature = 0.0model = OpenAI(model_name=model_name, temperature=temperature)# Define your desired data structure.class Joke(BaseModel): setup: str = Field(description="question to set up a joke") punchline: str = Field(description="answer to resolve the joke") # You ca...
https://python.langchain.com/docs/modules/model_io/output_parsers/
b2e5514e233d-0
Retry parser | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/retry
b2e5514e233d-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/retry
b2e5514e233d-2
= prompt.format_prompt(query="who is leo di caprios gf?")bad_response = '{"action": "search"}'If we try to parse this response as is, we will get an errorparser.parse(bad_response) --------------------------------------------------------------------------- ValidationError Traceback (most...
https://python.langchain.com/docs/modules/model_io/output_parsers/retry
b2e5514e233d-3
line 1 ----> 1 parser.parse(bad_response) File ~/workplace/langchain/langchain/output_parsers/pydantic.py:29, in PydanticOutputParser.parse(self, text) 27 name = self.pydantic_object.__name__ 28 msg = f"Failed to parse {name} from completion {text}. Got: {e}" ---> 29 raise OutputParserException...
https://python.langchain.com/docs/modules/model_io/output_parsers/retry
f81e7c539339-0
Enum parser | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/enum
f81e7c539339-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/enum
f81e7c539339-2
EnumMeta.__call__(cls, value, names, module, qualname, type, start) 314 if names is None: # simple value lookup --> 315 return cls.__new__(cls, value) 316 # otherwise, functional API: we're creating a new Enum type File ~/.pyenv/versions/3.9.1/lib/python3.9/enum.py:611, in Enum.__new__(cls, val...
https://python.langchain.com/docs/modules/model_io/output_parsers/enum
f81e7c539339-3
29 f"expected values: {self._valid_values}" 30 ) OutputParserException: Response 'yellow' is not one of the expected values: ['red', 'green', 'blue']PreviousDatetime parserNextAuto-fixing parserCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/model_io/output_parsers/enum
6f5e4b906b41-0
Datetime parser | 🦜�🔗 Langchain Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry...
https://python.langchain.com/docs/modules/model_io/output_parsers/datetime
9aee13b1f296-0
Auto-fixing parser | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/output_fixing_parser
9aee13b1f296-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/output_fixing_parser
9aee13b1f296-2
JSONDecodeError Traceback (most recent call last) File ~/workplace/langchain/langchain/output_parsers/pydantic.py:23, in PydanticOutputParser.parse(self, text) 22 json_str = match.group() ---> 23 json_object = json.loads(json_str) 24 return self.pydantic_object.parse_...
https://python.langchain.com/docs/modules/model_io/output_parsers/output_fixing_parser
9aee13b1f296-3
336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() File ~/.pyenv/versions/3.9.1/lib/python3.9/json/decoder.py:353, in JSONDecoder.raw_decode(self, s, idx) 352 try: --> 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: JS...
https://python.langchain.com/docs/modules/model_io/output_parsers/output_fixing_parser
9aee13b1f296-4
(char 1)Now we can construct and use a OutputFixingParser. This output parser takes as an argument another output parser but also an LLM with which to try to correct any formatting mistakes.from langchain.output_parsers import OutputFixingParsernew_parser = OutputFixingParser.from_llm(parser=parser, llm=ChatOpenAI())ne...
https://python.langchain.com/docs/modules/model_io/output_parsers/output_fixing_parser
840ec3e8b296-0
Structured output parser | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/structured
840ec3e8b296-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/structured
840ec3e8b296-2
= prompt.format_prompt(question="what's the capital of france?")output = model(_input.to_string())output_parser.parse(output) {'answer': 'Paris', 'source': 'https://www.worldatlas.com/articles/what-is-the-capital-of-france.html'}And here's an example of using this in a chat modelchat_model = ChatOpenAI(temperatu...
https://python.langchain.com/docs/modules/model_io/output_parsers/structured
05ab0be052c5-0
Pydantic (JSON) parser | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic
05ab0be052c5-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry parserStructured output parserData connectio...
https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic
05ab0be052c5-2
validation logic easily with Pydantic. @validator("setup") def question_ends_with_question_mark(cls, field): if field[-1] != "?": raise ValueError("Badly formed question!") return field# And a query intented to prompt a language model to populate the data structure.joke_query = "Tell me a...
https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic
05ab0be052c5-3
Hanks', film_names=['Forrest Gump', 'Saving Private Ryan', 'The Green Mile', 'Cast Away', 'Toy Story'])PreviousAuto-fixing parserNextRetry parserCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic
539b6e7cc333-0
List parser | 🦜�🔗 Langchain Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsOutput parsersList parserDatetime parserEnum parserAuto-fixing parserPydantic (JSON) parserRetry par...
https://python.langchain.com/docs/modules/model_io/output_parsers/comma_separated
0abf92c8e00f-0
Language models | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/
0abf92c8e00f-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcosystemAdditional resourcesModulesModel I/​OLanguage ...
https://python.langchain.com/docs/modules/model_io/models/
0abf92c8e00f-2
If you are using a specific model it's recommended you use the methods specific to that model class (i.e., "predict" for LLMs and "predict messages" for Chat Models), but if you're creating an application that should work with different types of models the shared interface can be helpful.PreviousSelect by similarityNex...
https://python.langchain.com/docs/modules/model_io/models/
ea5b539c496a-0
Chat models | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/chat/
ea5b539c496a-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcos...
https://python.langchain.com/docs/modules/model_io/models/chat/
ea5b539c496a-2
The types of messages currently supported in LangChain are AIMessage, HumanMessage, SystemMessage, and ChatMessage -- ChatMessage takes in an arbitrary role parameter. Most of the time, you'll just be dealing with HumanMessage, AIMessage, and SystemMessage__call__​Messages in -> message out​You can get chat complet...
https://python.langchain.com/docs/modules/model_io/models/chat/
ea5b539c496a-3
LLMResult(generations=[[ChatGeneration(text="J'aime programmer.", generation_info=None, message=AIMessage(content="J'aime programmer.", additional_kwargs={}))], [ChatGeneration(text="J'aime l'intelligence artificielle.", generation_info=None, message=AIMessage(content="J'aime l'intelligence artificielle.", additional_k...
https://python.langchain.com/docs/modules/model_io/models/chat/
73a642ea63b0-0
LLMChain | 🦜�🔗 Langchain Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChains...
https://python.langchain.com/docs/modules/model_io/models/chat/llm_chain
7024fb7919bc-0
Caching | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/chat/chat_model_caching
7024fb7919bc-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcos...
https://python.langchain.com/docs/modules/model_io/models/chat/chat_model_caching
7024fb7919bc-2
It can speed up your application by reducing the number of API calls you make to the LLM provider.import langchainfrom langchain.chat_models import ChatOpenAIllm = ChatOpenAI()In Memory Cache​from langchain.cache import InMemoryCachelangchain.llm_cache = InMemoryCache()# The first time, it is not yet in cache, so it ...
https://python.langchain.com/docs/modules/model_io/models/chat/chat_model_caching
7024fb7919bc-3
me a joke") CPU times: user 2.46 ms, sys: 1.23 ms, total: 3.7 ms Wall time: 2.67 ms '\n\nWhy did the chicken cross the road?\n\nTo get to the other side.'PreviousChat modelsNextHuman input Chat ModelCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/model_io/models/chat/chat_model_caching
7ed94564609e-0
Streaming | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/chat/streaming
7ed94564609e-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcos...
https://python.langchain.com/docs/modules/model_io/models/chat/streaming
7ed94564609e-2
quench my thirst A drink that always comes first Chorus: Sparkling water, oh so fine A drink that's always on my mind With every sip, I feel alive Sparkling water, you're my vibe Bridge: From the mountains to the sea Sparkling water, you're the key To a healthy life, a happy soul ...
https://python.langchain.com/docs/modules/model_io/models/chat/streaming
e645b88d39cb-0
Prompts | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/chat/prompts
e645b88d39cb-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcos...
https://python.langchain.com/docs/modules/model_io/models/chat/prompts
e645b88d39cb-2
la programmation.", additional_kwargs={})If you wanted to construct the MessagePromptTemplate more directly, you could create a PromptTemplate outside and then pass it in, eg:prompt=PromptTemplate( template="You are a helpful assistant that translates {input_language} to {output_language}.", input_variables=["inp...
https://python.langchain.com/docs/modules/model_io/models/chat/prompts
75cd6f3caa96-0
Human input Chat Model | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsChat modelsCachingHuman input Chat ModelLLMChainPromptsStreamingOutput parsersData connectionChainsMemoryAgentsCallbacksModulesGuidesEcos...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-2
message ======= type: system data: content: "Answer the following questions as best you can. You have access to the following tools:\n\nWikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subj...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-3
type: human data: content: 'What is Bocchi the Rock? ' additional_kwargs: {} example: false ======= end of message ======= Action: ``` { "action": "Wikipedia", "action_input": "What is Bocchi the Rock?" } ``` Observation: Page: Bocchi the Rock...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-4
lit. "Bocchi Hitori's ____ Life" or "The ____ Life of Being Alone") is a Japanese yonkoma manga series written and illustrated by Katsuwo. It was serialized in ASCII Media Works' Comic Dengeki Daioh "g" magazine from September 2013 to April 2021. Eight tank�bon volumes have been released. An anime television series ad...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-5
You have access to the following tools:\n\nWikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.\n\nThe way you use the tools is by specifying a json blob.\nSpecifically, t...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-6
previous work (but I haven't seen any of it! I only see what you return as final answer):\nAction:\n```\n{\n \"action\": \"Wikipedia\",\n \"action_input\": \"What is Bocchi the Rock?\"\n}\n```\nObservation: Page: Bocchi the Rock!\nSummary: Bocchi the Rock! (���・�・���!, Botchi Za Rokku!) is a Japanes...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-7
television series adaptation by C2C aired from April to June 2019.\n\nPage: Kessoku Band (album)\nSummary: Kessoku Band (Japanese: ���ンド, Hepburn: Kessoku Bando) is the debut studio album by Kessoku Band, a fictional musical group from the anime television series Bocchi the Rock!, released digitally on Decemb...
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
75cd6f3caa96-8
series and anime television series. The series has been praised for its writing, comedy, characters, and depiction of social anxiety, with the anime's visual creativity receiving acclaim."}PreviousCachingNextLLMChainCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model
7e74a09db5e0-0
LLMs | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/llms/
7e74a09db5e0-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsAsync APICustom LLMFake LLMHuman input LLMCachingSerializationStreamingTracking token usageChat modelsOutput parsersData connectionChains...
https://python.langchain.com/docs/modules/model_io/models/llms/
7e74a09db5e0-2
LangChain does not serve its own LLMs, but rather provides a standard interface for interacting with many different LLMs.Get started​There are lots of LLM providers (OpenAI, Cohere, Hugging Face, etc) - the LLM class is designed to provide a standard interface for all of them.In this walkthrough we'll work with an Op...
https://python.langchain.com/docs/modules/model_io/models/llms/
7e74a09db5e0-3
30llm_result.generations[0] [Generation(text='\n\nWhy did the chicken cross the road?\n\nTo get to the other side!'), Generation(text='\n\nWhy did the chicken cross the road?\n\nTo get to the other side.')]llm_result.generations[-1] [Generation(text="\n\nWhat if love neverspeech\n\nWhat if love never ended\n\...
https://python.langchain.com/docs/modules/model_io/models/llms/
e1316f72e864-0
Human input LLM | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsAsync APICustom LLMFake LLMHuman input LLMCachingSerializationStreamingTracking token usageChat modelsOutput parsersData connectionChains...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-2
===PROMPT==== Answer the following questions as best you can. You have access to the following tools: Wikipedia: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, historical events, or other subjects. Input should be a search query. Use th...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-3
Its chapters have been collected in five tank�bon volumes as of November 2022. An anime television series adaptation produced by CloverWorks aired from October to December 2022. The series has been praised for its writing, comedy, characters, and depiction of social anxiety, with the anime's visual creativity recei...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-4
Useful for when you need to answer general questions about people, places, companies, historical events, or other subjects. Input should be a search query. Use the following format: Question: the input question you must answer Thought: you should always think about what to do Action: the action to t...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-5
with the anime's visual creativity receiving acclaim. Page: Manga Time Kirara Summary: Manga Time Kirara (�ん�タイム�らら, Manga Taimu Kirara) is a Japanese seinen manga magazine published by Houbunsha which mainly serializes four-panel manga. The magazine is sold on the ninth of each month and wa...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-6
Bocchi Za Rokku!) is a Japanese four-panel manga series written and illustrated by Aki Hamaji. It has been serialized in Houbunsha's seinen manga magazine Manga Time Kirara Max since December 2017. Its chapters have been collected in five tank�bon volumes as of November 2022. An anime television series adaptation p...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-7
and anime series. Observation: Page: Bocchi the Rock! Summary: Bocchi the Rock! (���・�・���!, Bocchi Za Rokku!) is a Japanese four-panel manga series written and illustrated by Aki Hamaji. It has been serialized in Houbunsha's seinen manga magazine Manga Time Kirara Max since December 2017. Its c...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-8
It is the third magazine of the "Kirara" series, after "Manga Time Kirara" and "Manga Time Kirara Carat". The first issue was released on September 29, 2004. Currently the magazine is released on the 19th of each month. Thought:These are not relevant articles. Action: Wikipedia Action Input: Bocchi the Rock!, ...
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
e1316f72e864-9
praised for its writing, comedy, characters, and depiction of social anxiety, with the anime's visual creativity receiving acclaim."PreviousFake LLMNextCachingCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright © 2023 LangChain, Inc.
https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm
39dc43079643-0
Streaming | 🦜�🔗 Langchain
https://python.langchain.com/docs/modules/model_io/models/llms/streaming_llm
39dc43079643-1
Skip to main content🦜�🔗 LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKGet startedIntroductionInstallationQuickstartModulesModel I/​OPromptsLanguage modelsLLMsAsync APICustom LLMFake LLMHuman input LLMCachingSerializationStreamingTracking token usageChat modelsOutput parsersData connectionChains...
https://python.langchain.com/docs/modules/model_io/models/llms/streaming_llm
39dc43079643-2
water, sparkling water, It's the best way to stay hydrated, It's so crisp and so clean, It's the perfect way to stay refreshed. Verse 2 I'm sippin' on sparkling water, It's so bubbly and bright, It's the perfect way to cool me down On a hot summer night. Chorus Sparkling water, spa...
https://python.langchain.com/docs/modules/model_io/models/llms/streaming_llm