pub struct Synth { /* private fields */ }Expand description
Implementations§
Source§impl Synth
impl Synth
Sourcepub fn new(api_key: impl Into<String>, base_url: Option<&str>) -> Result<Self>
pub fn new(api_key: impl Into<String>, base_url: Option<&str>) -> Result<Self>
Create a new Synth client with explicit credentials.
§Arguments
api_key- Your Synth API keybase_url- Optional custom API base URL
Sourcepub fn api_key_masked(&self) -> String
pub fn api_key_masked(&self) -> String
Get the API key (masked for display).
Sourcepub fn core(&self) -> &SynthClient
pub fn core(&self) -> &SynthClient
Access the underlying core client.
Sourcepub fn optimize(&self) -> OptimizeBuilder
pub fn optimize(&self) -> OptimizeBuilder
Start a prompt optimization job.
Returns a builder to configure the optimization.
Sourcepub fn eval(&self) -> EvalBuilder
pub fn eval(&self) -> EvalBuilder
Start an evaluation job.
Returns a builder to configure the evaluation.
Sourcepub async fn tunnel(
&self,
port: u16,
backend: TunnelBackend,
) -> Result<TunnelHandle>
pub async fn tunnel( &self, port: u16, backend: TunnelBackend, ) -> Result<TunnelHandle>
Open a tunnel to a local port.
§Arguments
port- Local port to tunnelbackend- Tunnel backend (cloudflare_managed_lease recommended)
Sourcepub async fn submit_gepa(&self, request: GepaJobRequest) -> Result<String>
pub async fn submit_gepa(&self, request: GepaJobRequest) -> Result<String>
Submit a raw GEPA job.
Sourcepub async fn submit_mipro(&self, request: MiproJobRequest) -> Result<String>
pub async fn submit_mipro(&self, request: MiproJobRequest) -> Result<String>
Submit a raw MIPRO job.
Sourcepub async fn get_job_status(&self, job_id: &str) -> Result<PromptLearningResult>
pub async fn get_job_status(&self, job_id: &str) -> Result<PromptLearningResult>
Get job status.
Sourcepub async fn poll_job(
&self,
job_id: &str,
timeout_secs: f64,
interval_secs: f64,
) -> Result<PromptLearningResult>
pub async fn poll_job( &self, job_id: &str, timeout_secs: f64, interval_secs: f64, ) -> Result<PromptLearningResult>
Poll job until complete.
Sourcepub async fn complete(
&self,
request: GraphCompletionRequest,
) -> Result<GraphCompletionResponse>
pub async fn complete( &self, request: GraphCompletionRequest, ) -> Result<GraphCompletionResponse>
Run graph completion.
Sourcepub async fn verify(
&self,
trace: Value,
rubric: Value,
options: Option<VerifierOptions>,
) -> Result<VerifierResponse>
pub async fn verify( &self, trace: Value, rubric: Value, options: Option<VerifierOptions>, ) -> Result<VerifierResponse>
Run verifier on a trace.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Synth
impl !RefUnwindSafe for Synth
impl Send for Synth
impl Sync for Synth
impl Unpin for Synth
impl !UnwindSafe for Synth
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request