Revert "Add logging for request and response"
This reverts commit 6a93328785.
This commit is contained in:
parent
070dbcc81a
commit
cedec34b48
1 changed files with 1 additions and 18 deletions
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -14,7 +13,6 @@ import (
|
||||||
"github.com/openai/openai-go/v3"
|
"github.com/openai/openai-go/v3"
|
||||||
"github.com/openai/openai-go/v3/responses"
|
"github.com/openai/openai-go/v3/responses"
|
||||||
|
|
||||||
"github.com/sipeed/picoclaw/pkg/logger"
|
|
||||||
"github.com/sipeed/picoclaw/pkg/providers/common"
|
"github.com/sipeed/picoclaw/pkg/providers/common"
|
||||||
orc "github.com/sipeed/picoclaw/pkg/providers/openai_responses_common"
|
orc "github.com/sipeed/picoclaw/pkg/providers/openai_responses_common"
|
||||||
"github.com/sipeed/picoclaw/pkg/providers/protocoltypes"
|
"github.com/sipeed/picoclaw/pkg/providers/protocoltypes"
|
||||||
|
|
@ -139,11 +137,6 @@ func (p *Provider) Chat(
|
||||||
return nil, fmt.Errorf("failed to marshal request: %w", err)
|
return nil, fmt.Errorf("failed to marshal request: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.InfoCF("provider.azure", "Responses API request", map[string]any{
|
|
||||||
"url": requestURL,
|
|
||||||
"body": string(jsonData),
|
|
||||||
})
|
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "POST", requestURL, bytes.NewReader(jsonData))
|
req, err := http.NewRequestWithContext(ctx, "POST", requestURL, bytes.NewReader(jsonData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create request: %w", err)
|
return nil, fmt.Errorf("failed to create request: %w", err)
|
||||||
|
|
@ -164,17 +157,7 @@ func (p *Provider) Chat(
|
||||||
return nil, common.HandleErrorResponse(resp, p.apiBase)
|
return nil, common.HandleErrorResponse(resp, p.apiBase)
|
||||||
}
|
}
|
||||||
|
|
||||||
respBody, err := io.ReadAll(resp.Body)
|
return orc.ParseResponseBody(resp.Body, &p.lastResponseID)
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("failed to read response body: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.InfoCF("provider.azure", "Responses API response", map[string]any{
|
|
||||||
"status": resp.StatusCode,
|
|
||||||
"body": string(respBody),
|
|
||||||
})
|
|
||||||
|
|
||||||
return orc.ParseResponseBody(bytes.NewReader(respBody), &p.lastResponseID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDefaultModel returns an empty string as Azure deployments are user-configured.
|
// GetDefaultModel returns an empty string as Azure deployments are user-configured.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue