MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / new

Method new

tools/xtask-llm-benchmark/src/api/client.rs:20–30  ·  view source on GitHub ↗
(base_url: &str, api_key: &str)

Source from the content-addressed store, hash-verified

18
19impl ApiClient {
20 pub fn new(base_url: &str, api_key: &str) -> Result<Self> {
21 let client = reqwest::blocking::Client::builder()
22 .timeout(std::time::Duration::from_secs(120))
23 .build()
24 .context("failed to build HTTP client")?;
25 Ok(Self {
26 client,
27 base_url: base_url.trim_end_matches('/').to_string(),
28 api_key: api_key.to_string(),
29 })
30 }
31
32 /// Build from environment variables `LLM_BENCHMARK_UPLOAD_URL` and `LLM_BENCHMARK_API_KEY`.
33 /// Returns `None` if `LLM_BENCHMARK_UPLOAD_URL` is not set.

Callers

nothing calls this directly

Calls 4

OkFunction · 0.50
buildMethod · 0.45
timeoutMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected