MacPaw / OpenAI

Swift community driven package for OpenAI public API
MIT License
2.11k stars 353 forks source link

Chore: Add initializer for `FunctionCall` #186

Open thekoc opened 8 months ago

thekoc commented 8 months ago

What

Add a public initializer for ChatQuery.ChatCompletionMessageParam.ChatCompletionAssistantMessageParam.ChatCompletionMessageToolCallParam.FunctionCall, allowing it to be created programmatically.

Why

When converting chat history from other LLM services (such as Claude and Gemini) into the OpenAI format, it is necessary to create instances of the FunctionCall struct programmatically. However, the initializer for the FunctionCall struct is currently missing, making it impossible to create instances of this struct from code outside the package.

Affected Areas

Only ChatQuery.ChatCompletionMessageParam.ChatCompletionAssistantMessageParam.ChatCompletionMessageToolCallParam.FunctionCall

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud