33"""
44
55import os
6+ from datetime import datetime
67import re
78from typing import List , Dict , Any , Optional
89import pandas as pd
5051 "max_concurrency" : 16 ,
5152 },
5253 "kimi-k2-instruct-0905" : {
53- "model" : "kimi-k2-instruct-0905" ,
54+ "model" : "accounts/fireworks/models/ kimi-k2-instruct-0905" ,
5455 "temperature" : 0.6 , # Kimi recommended temperature
5556 "max_tokens" : 131000 ,
5657 "api_key" : os .getenv ("FIREWORKS_API_KEY" ),
@@ -230,6 +231,8 @@ def fetch_langfuse_traces_as_evaluation_rows(
230231 user_id : Optional [str ] = None ,
231232 session_id : Optional [str ] = None ,
232233 hours_back : Optional [int ] = None ,
234+ from_timestamp : Optional [datetime ] = None ,
235+ to_timestamp : Optional [datetime ] = None ,
233236 include_tool_calls : bool = True ,
234237 page_size : int = 30 ,
235238 sleep_between_gets : float = 0.1 ,
@@ -244,6 +247,8 @@ def fetch_langfuse_traces_as_evaluation_rows(
244247 user_id: Filter traces by user ID
245248 session_id: Filter traces by session ID
246249 hours_back: Only fetch traces from the last N hours
250+ from_timestamp: Only include traces with timestamp >= this datetime
251+ to_timestamp: Only include traces with timestamp <= this datetime
247252 include_tool_calls: Whether to include tool calls in messages
248253 page_size: Number of traces to fetch per page (smaller = less rate limit issues)
249254 sleep_between_gets: Sleep time between individual trace.get() calls (2.5s for 30 req/min limit)
@@ -262,6 +267,8 @@ def fetch_langfuse_traces_as_evaluation_rows(
262267 user_id = user_id ,
263268 session_id = session_id ,
264269 hours_back = hours_back ,
270+ from_timestamp = from_timestamp ,
271+ to_timestamp = to_timestamp ,
265272 include_tool_calls = include_tool_calls ,
266273 page_size = page_size ,
267274 sleep_between_gets = sleep_between_gets ,
0 commit comments