server

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const OKResponse = "OK"
View Source
const ReadHeaderTimeout = 5 * time.Second

Variables

This section is empty.

Functions

func Create

func Create(appState *models.AppState) *http.Server

Create creates a new HTTP server with the given app state

func DeleteMemoryHandler

func DeleteMemoryHandler(appState *models.AppState) http.HandlerFunc

DeleteMemoryHandler godoc

@Summary		Delete memory messages for a given session
@Description	delete memory messages by session id
@Tags			memory
@Accept			json
@Produce		json
@Param			session_id	path		string		true	"Session ID"
@Success		200			{string}	string		"OK"
@Failure		404			{object}	APIError	"Not Found"
@Failure		500			{object}	APIError	"Internal Server Error"
@Router			/api/v1/sessions/{sessionId}/memory [delete]

func GetMemoryHandler

func GetMemoryHandler(appState *models.AppState) http.HandlerFunc

GetMemoryHandler godoc

@Summary		Returns a memory (latest summary and list of messages) for a given session
@Description	get memory by session id
@Tags			memory
@Accept			json
@Produce		json
@Param			session_id	path		string	true	"Session ID"
@Param			lastn		query		integer	false	"Last N messages. Overrides memory_window configuration"
@Success		200			{object}	[]models.Memory
@Failure		404			{object}	APIError	"Not Found"
@Failure		500			{object}	APIError	"Internal Server Error"
@Router			/api/v1/sessions/{sessionId}/memory [get]

func PostMemoryHandler

func PostMemoryHandler(appState *models.AppState) http.HandlerFunc

PostMemoryHandler godoc

@Summary		Add memory messages to a given session
@Description	add memory messages by session id
@Tags			memory
@Accept			json
@Produce		json
@Param			session_id		path		string			true	"Session ID"
@Param			memoryMessages	body		models.Memory	true	"Memory messages"
@Success		200				{string}	string			"OK"
@Failure		404				{object}	APIError		"Not Found"
@Failure		500				{object}	APIError		"Internal Server Error"
@Router			/api/v1/sessions/{sessionId}/memory [post]

func SearchMemoryHandler added in v0.6.0

func SearchMemoryHandler(appState *models.AppState) http.HandlerFunc

SearchMemoryHandler godoc

@Summary		Search memory messages for a given session
@Description	search memory messages by session id and query
@Tags			search
@Accept			json
@Produce		json
@Param			session_id		path		string					true	"Session ID"
@Param			limit			query		integer					false	"Limit the number of results returned"
@Param			searchPayload	body		models.MemorySearchPayload	true	"Search query"
@Success		200				{object}	[]models.MemorySearchResult
@Failure		404				{object}	APIError	"Not Found"
@Failure		500				{object}	APIError	"Internal Server Error"
@Router			/api/v1/sessions/{sessionId}/search [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL