LangChain is a software framework for developing applications powered by (large language models) LLMs. This document describes how to use LangChain to interact with SambaNova models.
View the following resources for more information:
Now you can instantiate a ChatSambaNovaCloud model object and generate chat completions, as shown in the example below. The example below uses Meta’s Llama 3.3 70B.
Copy
Ask AI
from langchain_sambanova import ChatSambaNovaCloudllm = ChatSambaNovaCloud( model="Meta-Llama-3.3-70B-Instruct", max_tokens=1024, temperature=0.7, top_p=0.01,)
messages = [ ( "system", "You are a helpful assistant that translates English to French. " "Translate the user sentence.", ), ("human", "I love programming."),]ai_msg = llm.invoke(messages)print(ai_msg.content)
You should see an output similar to the one below.