File tree Expand file tree Collapse file tree
src/bespokelabs/curator/llm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88# Use GPT-4o-mini for this example.
99llm = curator .LLM (model_name = "gpt-4o-mini" )
1010poem = llm (["Write a poem about the importance of data in AI." ])
11- print (poem .to_pandas ().iloc [0 ]["response" ])
11+ print (poem .dataset . to_pandas ().iloc [0 ]["response" ])
1212
1313# Use Claude 3.5 Sonnet for this example.
14- llm = curator .LLM (model_name = "claude-3-5- sonnet-20240620 " , backend = "litellm " )
14+ llm = curator .LLM (model_name = "claude-sonnet-4-20250514 " , backend = "anthropic " )
1515poem = llm (["Write a poem about the importance of data in AI." ])
16- print (poem .to_pandas ().iloc [0 ]["response" ])
16+ print (poem .dataset . to_pandas ().iloc [0 ]["response" ])
1717
1818# Note that we can also pass a list of prompts to generate multiple responses.
1919poems = llm (
Original file line number Diff line number Diff line change @@ -571,9 +571,11 @@ def _write_fast_path_failed_requests(
571571 return failed_requests_path
572572
573573
574- def _is_message_list (list : list ) -> bool :
574+ def _is_message_list (value : Any ) -> bool :
575575 """Check if a list is a list of messages."""
576- return all (isinstance (item , dict ) and "role" in item and "content" in item for item in list )
576+ if not isinstance (value , list ):
577+ return False
578+ return all (isinstance (item , dict ) and "role" in item and "content" in item for item in value )
577579
578580
579581def _raw_input_to_rows (raw_input ) -> list [dict ]:
You can’t perform that action at this time.
0 commit comments