Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
227
ai.go1.03 kB
package ai import ( "context" "github.com/Southclaws/storyden/internal/config" ) type Result struct { Answer string } type Embedder func(ctx context.Context, text string) ([]float32, error) type Prompter interface { Prompt(ctx context.Context, input string) (*Result, error) PromptStream(ctx context.Context, input string) (func(yield func(string, error) bool), error) EmbeddingFunc() func(ctx context.Context, text string) ([]float32, error) } func New(cfg config.Config) (Prompter, error) { switch cfg.LanguageModelProvider { case "openai": return newOpenAI(cfg) case "mock": return newMock() default: return &Disabled{}, nil } } type Disabled struct{} func (d *Disabled) Prompt(ctx context.Context, input string) (*Result, error) { return nil, nil } func (d *Disabled) PromptStream(ctx context.Context, input string) (func(yield func(string, error) bool), error) { return nil, nil } func (d *Disabled) EmbeddingFunc() func(ctx context.Context, text string) ([]float32, error) { return nil }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server