Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
henomis committed Nov 7, 2023
1 parent 1c0f4e6 commit 3a6803c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions assistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (c *Client) DeleteAssistant(
return
}

// ListAssistants Lists the currently available assistants
// ListAssistants Lists the currently available assistants.
func (c *Client) ListAssistants(
ctx context.Context,
limit *int,
Expand Down Expand Up @@ -221,7 +221,7 @@ func (c *Client) DeleteAssistantFile(
return
}

// ListAssistantFiles Lists the currently available files for an assistant,
// ListAssistantFiles Lists the currently available files for an assistant.
func (c *Client) ListAssistantFiles(
ctx context.Context,
assistantID string,
Expand Down
12 changes: 6 additions & 6 deletions assistant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ func TestAssistant(t *testing.T) {
assistantID := "asst_abc123"
assistantName := "Ambrogio"
assistantDescription := "Ambrogio is a friendly assistant."
assitantInstructions := "You are a personal math tutor. When asked a question, write and run Python code to answer the question."
assitantInstructions := `You are a personal math tutor.
When asked a question, write and run Python code to answer the question.`
assistantFileID := "file-wB6RM6wHdA49HfS2DJ9fEyrH"
limit := 20
order := "desc"
Expand Down Expand Up @@ -82,7 +83,8 @@ func TestAssistant(t *testing.T) {
server.RegisterHandler(
"/v1/assistants/"+assistantID,
func(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodGet {
switch r.Method {
case http.MethodGet:
resBytes, _ := json.Marshal(openai.Assistant{
ID: assistantID,
Object: "assistant",
Expand All @@ -93,7 +95,7 @@ func TestAssistant(t *testing.T) {
Instructions: &assitantInstructions,
})
fmt.Fprintln(w, string(resBytes))
} else if r.Method == http.MethodPost {
case http.MethodPost:
var request openai.AssistantRequest
err := json.NewDecoder(r.Body).Decode(&request)
checks.NoError(t, err, "Decode error")
Expand All @@ -109,7 +111,7 @@ func TestAssistant(t *testing.T) {
Tools: request.Tools,
})
fmt.Fprintln(w, string(resBytes))
} else if r.Method == http.MethodDelete {
case http.MethodDelete:
fmt.Fprintln(w, `{
"id": "asst_abc123",
"object": "assistant.deleted",
Expand All @@ -122,7 +124,6 @@ func TestAssistant(t *testing.T) {
server.RegisterHandler(
"/v1/assistants",
func(w http.ResponseWriter, r *http.Request) {

if r.Method == http.MethodPost {
var request openai.AssistantRequest
err := json.NewDecoder(r.Body).Decode(&request)
Expand Down Expand Up @@ -198,5 +199,4 @@ func TestAssistant(t *testing.T) {

err = client.DeleteAssistantFile(ctx, assistantID, assistantFileID)
checks.NoError(t, err, "DeleteAssistantFile error")

}

0 comments on commit 3a6803c

Please sign in to comment.