Skip to content
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

parameter naming of CreateMessageRequest in OpenAI.Threads #219

Closed
ludson opened this issue Jan 12, 2024 · 2 comments · Fixed by #222 or RageAgainstThePixel/com.openai.unity#165
Closed
Assignees
Labels
bug Something isn't working

Comments

@ludson
Copy link

ludson commented Jan 12, 2024

Issue Description 🔎
Context: I've noticed a potential discrepancy in the CreateMessageRequest class within the OpenAI.Threads namespace, specifically regarding the naming of a property.

Current Implementation 🐛
The class currently has a property named fieldIds. This is highlighted in the code snippet below:

namespace OpenAI.Threads
{
public sealed class CreateMessageRequest
{
// ... other properties ...

[JsonPropertyName("file_ids")]
public IReadOnlyList<string> **FieldIds** { get; } // Note the naming here

Suggested Change 💡
However, based on the JsonPropertyName attribute ("file_ids"), it seems that the intended name for this property should be fileIds. This change could enhance clarity and reduce potential confusion in the code. Here's how it could look:

namespace OpenAI.Threads
{
public sealed class CreateMessageRequest
{
// ... other properties ...
[JsonPropertyName("file_ids")]
public IReadOnlyList<string> FileIds { get; } // Updated naming

Recommendation 📝
I recommend reviewing and possibly updating the property name to ensure it aligns with its intended purpose, enhancing code readability and maintainability.

@StephenHodgson
Copy link
Member

Product of dyslexia 🥴

@StephenHodgson StephenHodgson self-assigned this Jan 12, 2024
@StephenHodgson StephenHodgson added the bug Something isn't working label Jan 12, 2024
@StephenHodgson
Copy link
Member

StephenHodgson commented Jan 14, 2024

Just to be clear the name of the property was ok. It was only the name of the parameter in the .ctr that was malformed.

public IReadOnlyList<string> FileIds { get; }

FileIds = fieldIds?.ToList();

@StephenHodgson StephenHodgson changed the title Property Naming of CreateMessageRequest in OpenAI.Threads parameter naming of CreateMessageRequest in OpenAI.Threads Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants