mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection these were generated from was a month old and predated the compute migration, so every one of them described /v1/visor — which the API serves at zero paths now. That is why a hand-written console client and a generated one had drifted the same way at the same time. No /v1/visor path survives here. The word still appears as a source-plane value and inside gvisor and supervisor, which are not this rename.
122 lines
3.4 KiB
C++
122 lines
3.4 KiB
C++
/**
|
|
* Hanzo Cloud API
|
|
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
*
|
|
* The version of the OpenAPI document: v1
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* ContextBundle.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_ContextBundle_H_
|
|
#define HANZO_MODEL_ContextBundle_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include "hanzo/model/Span.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <vector>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
class Span;
|
|
|
|
|
|
class ContextBundle
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
ContextBundle();
|
|
virtual ~ContextBundle();
|
|
|
|
/////////////////////////////////////////////
|
|
/// ModelBase overrides
|
|
|
|
void validate() override;
|
|
|
|
web::json::value toJson() const override;
|
|
bool fromJson(const web::json::value& json) override;
|
|
|
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// ContextBundle members
|
|
|
|
|
|
/// <summary>
|
|
/// BudgetTokens is the ceiling the caller asked for. Packing stops under it, so this is a bound and not a target.
|
|
/// </summary>
|
|
int64_t getBudgetTokens() const;
|
|
bool budgetTokensIsSet() const;
|
|
void unsetBudgetTokens();
|
|
void setBudgetTokens(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Query is the ask this bundle was packed for, echoed back so a cached or forwarded bundle still says what it answers.
|
|
/// </summary>
|
|
utility::string_t getQuery() const;
|
|
bool queryIsSet() const;
|
|
void unsetQuery();
|
|
void setQuery(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Repo narrows the retrieval to one repository. Absent means every indexed repo was searched.
|
|
/// </summary>
|
|
utility::string_t getRepo() const;
|
|
bool repoIsSet() const;
|
|
void unsetRepo();
|
|
void setRepo(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Spans are the packed chunks, most relevant first, each expanded with the definitions it calls and its notable callers. The top match is always present even if it had to be truncated to fit, so a matched query never comes back with nothing.
|
|
/// </summary>
|
|
std::vector<std::shared_ptr<Span>> getSpans() const;
|
|
bool spansIsSet() const;
|
|
void unsetSpans();
|
|
void setSpans(const std::vector<std::shared_ptr<Span>>& value);
|
|
|
|
/// <summary>
|
|
/// UsedTokens is what the returned spans actually cost, by the same estimate the packer used (roughly one token per four characters — an estimate, not a tokenizer's count, so size a real window with headroom).
|
|
/// </summary>
|
|
int64_t getUsedTokens() const;
|
|
bool usedTokensIsSet() const;
|
|
void unsetUsedTokens();
|
|
void setUsedTokens(int64_t value);
|
|
|
|
|
|
protected:
|
|
int64_t m_BudgetTokens;
|
|
bool m_BudgetTokensIsSet;
|
|
|
|
utility::string_t m_Query;
|
|
bool m_QueryIsSet;
|
|
|
|
utility::string_t m_Repo;
|
|
bool m_RepoIsSet;
|
|
|
|
std::vector<std::shared_ptr<Span>> m_Spans;
|
|
bool m_SpansIsSet;
|
|
|
|
int64_t m_UsedTokens;
|
|
bool m_UsedTokensIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_ContextBundle_H_ */
|