You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
581 B
Python

#|%%--%%| <v7QcmovzRW|SzAmGcGuz7>
from langchain_core.messages import HumanMessage, SystemMessage
from langchain_openai import ChatOpenAI
#|%%--%%| <SzAmGcGuz7|5hpjZkupU5>
messages = [
SystemMessage(content="You are a helpful assistant."),
HumanMessage(content="what is a good company name for colorful socks ?")
]
#|%%--%%| <5hpjZkupU5|qXWlUuUqLc>
chat = ChatOpenAI(temperature=0.2, model="dolphin-mixtral", max_tokens=50)
#|%%--%%| <qXWlUuUqLc|00yiGVKIRw>
result = chat.invoke(messages)
#|%%--%%| <00yiGVKIRw|ZrwfqMozR5>
print(result.content)