langchain/templates/anthropic-functions/anthropic_functions/chain.py
Erick Friis ebf998acb6
Templates (#12294)
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: Lance Martin <lance@langchain.dev>
Co-authored-by: Jacob Lee <jacoblee93@gmail.com>
2023-10-25 18:47:42 -07:00

15 lines
432 B
Python

from langchain.chains import create_tagging_chain
from langchain_experimental.llms.anthropic_functions import AnthropicFunctions
model = AnthropicFunctions(model='claude-2')
schema = {
"properties": {
"sentiment": {"type": "string"},
"aggressiveness": {"type": "integer"},
"language": {"type": "string"},
}
}
# This is LLMChain, which implements invoke
chain = create_tagging_chain(schema, model)