Skip to content

Commit

Permalink
- check on upstream if directive doesn't have the URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed Sep 4, 2024
1 parent bef6bfc commit 262a292
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/cli/llm/infer_field_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,17 @@ impl InferFieldName {
for (field_name, field) in type_.fields.iter() {
// TODO: add support for gRPC resolver.
if let Some(Resolver::Http(http)) = &field.resolver {
let question = Question {
url: http.base_url.as_ref().unwrap().clone(),
method: http.method.to_string(),
};
let base_url = http
.base_url
.as_ref()
.or(config.upstream.base_url.as_ref())
.map(String::as_str)
.ok_or_else(|| {
Error::Err("Base URL is required for HTTP resolver".into())
})?;

let question =
Question { url: base_url.to_owned(), method: http.method.to_string() };

let mut delay = 3;
loop {
Expand Down

0 comments on commit 262a292

Please sign in to comment.