io.github.sinri.AiOnHttpMix.azure.bing.search.v7.BingSearchResponseImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AiOnHttpMix Show documentation
Show all versions of AiOnHttpMix Show documentation
A library to handle LLM APIs over HTTP service.
The newest version!
package io.github.sinri.AiOnHttpMix.azure.bing.search.v7;
import io.github.sinri.keel.core.json.UnmodifiableJsonifiableEntityImpl;
import io.vertx.core.json.JsonObject;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
class BingSearchResponseImpl extends UnmodifiableJsonifiableEntityImpl implements BingSearchResponse {
private final int statusCode;
private final Map headers;
private final String rawBody;
public BingSearchResponseImpl(
int statusCode,
Map headers,
@Nullable String rawBody
) {
super(prepareBody(rawBody));
this.statusCode = statusCode;
this.headers = headers;
this.rawBody = rawBody;
}
private static JsonObject prepareBody(String rawBody) {
try {
return new JsonObject(rawBody);
} catch (Throwable t) {
return new JsonObject();
}
}
@Override
public int getStatusCode() {
return statusCode;
}
@Override
public Map getHeaders() {
return headers;
}
@Override
public String getRawBody() {
return rawBody;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy