pub struct MathSolver { /* private fields */ }Expand description
BYOK client for an OpenAI-compatible endpoint.
let solver = mathsolver::MathSolver::new("sk-...", "https://api.deepseek.com/v1")
.unwrap().model("deepseek-chat");
let r = solver.solve("2x + 3 = 11, solve for x").unwrap(); // r.verified == trueImplementations§
Source§impl MathSolver
impl MathSolver
Sourcepub fn new(api_key: &str, base_url: &str) -> Result<Self, SolverError>
pub fn new(api_key: &str, base_url: &str) -> Result<Self, SolverError>
Create a client with the built-in HTTP transport (ureq).
Sourcepub fn with_transport<F>(
api_key: &str,
base_url: &str,
transport: F,
) -> Result<Self, SolverError>
pub fn with_transport<F>( api_key: &str, base_url: &str, transport: F, ) -> Result<Self, SolverError>
Create a client with an injected transport (url, body_json, api_key) -> model text.
Sourcepub fn solve(&self, problem: &str) -> Result<SolveResult, SolverError>
pub fn solve(&self, problem: &str) -> Result<SolveResult, SolverError>
Solve a math problem. The answer is the output of executing the model’s
program; verified is true only when the check expression passes
(equations: answer substituted back must satisfy the original equation).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MathSolver
impl !UnwindSafe for MathSolver
impl Forget for MathSolver
impl Freeze for MathSolver
impl Move for MathSolver
impl Send for MathSolver
impl Sync for MathSolver
impl Unpin for MathSolver
impl UnsafeUnpin for MathSolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more