Files

3.2 KiB

\AskAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
PostAsk Post /v1/ask Ask a grounded question about your own org
ResearchWeb Post /v1/ask/web Research a question on the live web and answer it with sources cited

PostAsk

PostAsk(ctx).AskRequest(askRequest).Execute()

Ask a grounded question about your own org

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	askRequest := *openapiclient.NewAskRequest() // AskRequest |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AskAPI.PostAsk(context.Background()).AskRequest(askRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AskAPI.PostAsk``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostAskRequest struct via the builder pattern

Name Type Description Notes
askRequest AskRequest

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResearchWeb

AskReport ResearchWeb(ctx).AskWebQuestion(askWebQuestion).Execute()

Research a question on the live web and answer it with sources cited

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	askWebQuestion := *openapiclient.NewAskWebQuestion() // AskWebQuestion | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AskAPI.ResearchWeb(context.Background()).AskWebQuestion(askWebQuestion).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AskAPI.ResearchWeb``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ResearchWeb`: AskReport
	fmt.Fprintf(os.Stdout, "Response from `AskAPI.ResearchWeb`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiResearchWebRequest struct via the builder pattern

Name Type Description Notes
askWebQuestion AskWebQuestion

Return type

AskReport

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]