use groq for kimi
Browse files212 unmodified lines213214215216217218219216217218219220220221222223224225226227753 unmodified lines981982983984985986987988989212 unmodified lines
# HF Inference ClientHF_TOKEN = os.getenv('HF_TOKEN')
def get_inference_client(model_id): """Return an InferenceClient with provider based on model_id.""" provider = "groq" if model_id == "moonshotai/Kimi-K2-Instruct" else "auto"client = InferenceClient( provider="auto", api_key=HF_TOKEN, bill_to="huggingface") return InferenceClient( provider=provider, api_key=HF_TOKEN, bill_to="huggingface" )
# Type definitionsHistory = List[Tuple[str, str]]753 unmodified lines # Enhance query with search if enabled enhanced_query = enhance_query_with_search(query, enable_search) # Use dynamic client based on selected model client = get_inference_client(_current_model["id"])
if image is not None: messages.append(create_multimodal_message(enhanced_query, image)) else:app.py+12-5