8000 Fix: use model credential and set proper options in sdk by StrongMonkey · Pull Request #627 · obot-platform/tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: use model credential and set proper options in sdk #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
11 changes: 9 additions & 2 deletions microsoft365/outlook/calendar/pkg/recurrence/recurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import (
_ "embed"
"encoding/json"
"fmt"
"os"
"strings"
"time"

"github.com/gptscript-ai/go-gptscript"
"github.com/obot-platform/tools/microsoft365/outlook/calendar/pkg/util"
"github.com/microsoft/kiota-abstractions-go/serialization"
"github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/obot-platform/tools/microsoft365/outlook/calendar/pkg/util"
)

// the source for doc.md: https://learn.microsoft.com/en-us/graph/outlook-schedule-recurring-events
Expand Down Expand Up @@ -116,7 +117,13 @@ func Generate(ctx context.Context, description string) (Recurrence, error) {

tool := getTool(description)

run, err := g.Evaluate(ctx, gptscript.Options{}, tool)
run, err := g.Evaluate(ctx, gptscript.Options{
GlobalOptions: gptscript.GlobalOptions{
OpenAIAPIKey: os.Getenv("OPENAI_API_KEY"),
OpenAIBaseURL: os.Getenv("OPENAI_BASE_URL"),
DefaultModel: os.Getenv("OBOT_DEFAULT_LLM_MINI_MODEL"),
},
}, tool)
if err != nil {
return Recurrence{}, err
}
Expand Down
1 change: 1 addition & 0 deletions microsoft365/outlook/calendar/tool.gpt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Name: Create Event
Description: Create a new event.
Share Context: Outlook Calendar Context, Recurrence Context
Credential: ../../credential
Credential: sys.model.provider.credential
Share Tools: List Calendars
Param: subject: (Required) The title of the event.
Param: location: (Required) The location of the event.
Expand Down
Loading
0