getDefaultParams constructs the default parameters for a chat completion request. The tool registry is managed centrally by the registry package. The chat history is constructed manually, so Store must be set to false.
(modelSlug string, toolRegistry *registry.ToolRegistry)
| 50 | // The tool registry is managed centrally by the registry package. |
| 51 | // The chat history is constructed manually, so Store must be set to false. |
| 52 | func getDefaultParams(modelSlug string, toolRegistry *registry.ToolRegistry) responses.ResponseNewParams { |
| 53 | var reasoningModels = []string{ |
| 54 | "gpt-5", |
| 55 | "gpt-5-mini", |
| 56 | "gpt-5-nano", |
| 57 | "gpt-5-chat-latest", |
| 58 | "o4-mini", |
| 59 | "o3-mini", |
| 60 | "o3", |
| 61 | "o1-mini", |
| 62 | "o1", |
| 63 | "codex-mini-latest", |
| 64 | } |
| 65 | if lo.Contains(reasoningModels, modelSlug) { |
| 66 | return responses.ResponseNewParams{ |
| 67 | Model: modelSlug, |
| 68 | Tools: toolRegistry.GetTools(), |
| 69 | Store: openaiv2.Bool(false), |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | return responses.ResponseNewParams{ |
| 74 | Model: modelSlug, |
| 75 | Temperature: openaiv2.Float(0.7), |
| 76 | MaxOutputTokens: openaiv2.Int(4000), // DEBUG POINT: change this to test the frontend handler |
| 77 | Tools: toolRegistry.GetTools(), // Tool registration is managed centrally by the registry |
| 78 | Store: openaiv2.Bool(false), // Must set to false, because we are construct our own chat history. |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func CheckOpenAIWorks(oaiClient openai.Client, logger *logger.Logger) { |
| 83 | logger.Info("[AI Client] checking if openai client works") |
no test coverage detected