mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 02:41:59 -04:00
24 lines
724 B
Plaintext
24 lines
724 B
Plaintext
```python
|
|
from langchain.messages import HumanMessage
|
|
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
HumanMessage(
|
|
content=(
|
|
"Write a Python function `find_duplicates(lst)` that returns a list of "
|
|
"all elements that appear more than once in the input list, in the order "
|
|
"they first appear."
|
|
)
|
|
)
|
|
],
|
|
"rubric": (
|
|
"- All tests pass in run_test_suite\n"
|
|
"- The function is named `find_duplicates` and accepts a single list argument\n"
|
|
),
|
|
},
|
|
config={"configurable": {"thread_id": "code-generation-session"}},
|
|
)
|
|
print(result["messages"][-1].text)
|
|
```
|