Skip to content

Commit

Permalink
Start on client GetModelDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
cheshire137 committed Oct 8, 2024
1 parent 7aa576e commit d75afc9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/azure_models/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -84,6 +85,29 @@ func (c *Client) GetChatCompletionStream(req ChatCompletionOptions) (*ChatComple
return &chatCompletionResponse, nil
}

func (c *Client) GetModelDetails(registry string, modelName string, version string) error {
url := fmt.Sprintf("%s/asset-gallery/v1.0/%s/models/%s/version/%s", azureAiStudioURL, registry, modelName, version)
httpReq, err := http.NewRequest("GET", url, nil)
if err != nil {
return err
}

httpReq.Header.Set("Content-Type", "application/json")

resp, err := c.client.Do(httpReq)
if err != nil {
return err
}

if resp.StatusCode != http.StatusOK {
return c.handleHTTPError(resp)
}

fmt.Println(resp.Body)

return nil
}

func (c *Client) ListModels() ([]*ModelSummary, error) {
body := bytes.NewReader([]byte(`
{
Expand Down

0 comments on commit d75afc9

Please sign in to comment.