update readmes

pull/4/head
Anonymous 1 year ago
parent 1d2e4718f1
commit 48989e6a0c

@ -17,8 +17,8 @@ For example, if there is a file at `prompts/qa/stuff/basic/prompt.yaml`, the pat
Once you have that path, you can load it in the following manner:
```python
from langchain.prompts import load_from_hub
prompt = load_from_hub("qa/stuff/basic/prompt.yaml")
from langchain.prompts import load_prompt
prompt = load_prompt('lc://prompts/qa/stuff/basic/prompt.yaml')
```
## Uploading

@ -17,12 +17,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import APIChain
llm = ...
api_docs = ...
prompt = load_from_hub('api/api_response/<file-name>')
prompt = load_prompt('lc://prompts/api/api_response/<file-name>')
chain = APIChain.from_llm_and_api_docs(llm, api_docs, api_response_prompt=prompt)
```

@ -15,12 +15,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import APIChain
llm = ...
api_docs = ...
prompt = load_from_hub('api/api_url/<file-name>')
prompt = load_prompt('lc://prompts/api/api_url/<file-name>')
chain = APIChain.from_llm_and_api_docs(llm, api_docs, api_url_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import ConversationChain
llm = ...
prompt = load_from_hub('conversation/<file-name>')
prompt = load_prompt('lc://prompts/conversation/<file-name>')
chain = ConversationChain(llm=llm, prompt=prompt)
```

@ -8,11 +8,11 @@ Basic prompt designed to be use as a test case, will just instruct the LLM to sa
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import LLMChain
llm = ...
prompt = load_from_hub('hello-world/<file-name>')
prompt = load_prompt('lc://prompts/hello-world/<file-name>')
chain = LLMChain(llm=llm, prompt=prompt)
```

@ -14,11 +14,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import LLMBashChain
llm = ...
prompt = load_from_hub('llm_bash/<file-name>')
prompt = load_prompt('lc://prompts/llm_bash/<file-name>')
chain = LLMBashChain(llm=llm, prompt=prompt)
```

@ -15,11 +15,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import LLMMathChain
llm = ...
prompt = load_from_hub('llm_math/<file-name>')
prompt = load_prompt('lc://prompts/llm_math/<file-name>')
chain = LLMMathChain(llm=llm, prompt=prompt)
```

@ -16,12 +16,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import ConversationChain
from langchain.chains.conversation.memory import ConversationSummaryMemory
llm = ...
prompt = load_from_hub('memory/summarize/<file-name>')
prompt = load_prompt('lc://prompts/memory/summarize/<file-name>')
memory = ConversationSummaryMemory(llm=llm, prompt=prompt)
chain = ConversationChain(llm=llm, memory=memory)
```

@ -16,13 +16,13 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import PALChain
llm = ...
stop = ...
get_answer_expr = ...
prompt = load_from_hub('pal/<file-name>')
prompt = load_prompt('lc://prompts/pal/<file-name>')
chain = PALChain(llm=llm, prompt=prompt, stop=stop, get_answer_expr=get_answer_expr)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.question_answering import load_qa_chain
llm = ...
prompt = load_from_hub('qa/map_reduce/question/<file-name>')
prompt = load_prompt('lc://prompts/qa/map_reduce/question/<file-name>')
chain = load_qa_chain(llm, chain_type="map_reduce", question_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.question_answering import load_qa_chain
llm = ...
prompt = load_from_hub('qa/map_reduce/reduce/<file-name>')
prompt = load_prompt('lc://prompts/qa/map_reduce/reduce/<file-name>')
chain = load_qa_chain(llm, chain_type="map_reduce", combine_prompt=prompt)
```

@ -17,11 +17,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.question_answering import load_qa_chain
llm = ...
prompt = load_from_hub('qa/refine/<file-name>')
prompt = load_prompt('lc://prompts/qa/refine/<file-name>')
chain = load_qa_chain(llm, chain_type="refine", refine_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.question_answering import load_qa_chain
llm = ...
prompt = load_from_hub('qa/stuff/<file-name>')
prompt = load_prompt('lc://prompts/qa/stuff/<file-name>')
chain = load_qa_chain(llm, chain_type="stuff", prompt=prompt)
```

@ -22,11 +22,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
llm = ...
prompt = load_from_hub('qa_with_sources/map_reduce/reduce/<file-name>')
prompt = load_prompt('lc://prompts/qa_with_sources/map_reduce/reduce/<file-name>')
chain = load_qa_with_sources_chain(llm, chain_type="map_reduce", combine_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
llm = ...
prompt = load_from_hub('qa_with_sources/refine/<file-name>')
prompt = load_prompt('lc://prompts/qa_with_sources/refine/<file-name>')
chain = load_qa_with_sources_chain(llm, chain_type="refine", refine_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.qa_with_sources import load_qa_with_sources_chain
llm = ...
prompt = load_from_hub('qa_with_sources/stuff/<file-name>')
prompt = load_prompt('lc://prompts/qa_with_sources/stuff/<file-name>')
chain = load_qa_with_sources_chain(llm, chain_type="stuff", prompt=prompt)
```

@ -18,12 +18,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import SQLDatabaseChain
llm = ...
database = ...
prompt = load_from_hub('sql_query/language_to_sql_output/<file-name>')
prompt = load_prompt('lc://prompts/sql_query/language_to_sql_output/<file-name>')
chain = SQLDatabaseChain(llm=llm, database=database, prompt=prompt)
```

@ -16,12 +16,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import SQLDatabaseSequentialChain
llm = ...
database = ...
prompt = load_from_hub('sql_query/relevant_tables/<file-name>')
prompt = load_prompt('lc://prompts/sql_query/relevant_tables/<file-name>')
chain = SQLDatabaseSequentialChain.from_llm(llm, database, decider_prompt=prompt)
```

@ -15,11 +15,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.summarize import load_summarize_chain
llm = ...
prompt = load_from_hub('summarize/map_reduce/map/<file-name>')
prompt = load_prompt('lc://prompts/summarize/map_reduce/map/<file-name>')
chain = load_summarize_chain(llm, chain_type="map_reduce", map_prompt=prompt)
```

@ -16,11 +16,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.summarize import load_summarize_chain
llm = ...
prompt = load_from_hub('summarize/refine/<file-name>')
prompt = load_prompt('lc://prompts/summarize/refine/<file-name>')
chain = load_summarize_chain(llm, chain_type="refine", refine_prompt=prompt)
```

@ -14,11 +14,11 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains.summarize import load_summarize_chain
llm = ...
prompt = load_from_hub('summarize/stuff/<file-name>')
prompt = load_prompt('lc://prompts/summarize/stuff/<file-name>')
chain = load_summarize_chain(llm, chain_type="stuff", prompt=prompt)
```

@ -16,12 +16,12 @@ This is a description of the inputs that the prompt expects.
Below is a code snippet for how to use the prompt.
```python
from langchain.prompts import load_from_hub
from langchain.prompts import load_prompt
from langchain.chains import VectorDBQA
llm = ...
vectorstore = ...
prompt = load_from_hub('vector_db_qa/<file-name>')
prompt = load_prompt('lc://prompts/vector_db_qa/<file-name>')
chain = VectorDBQA.from_llm(llm, prompt=prompt, vectorstore=vectorstore)
```

Loading…
Cancel
Save