-
Notifications
You must be signed in to change notification settings - Fork 268
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
Open AI Client wrapper for GoFr #1242
Comments
Hi, can you assign me this issue. Also i want to clear out a doubt that whether to build this in a separate folder at (new to OpenSource and first issue. so...) |
|
I have another doubt. i found that OpenAI has also developed it's wrapper so will it be okay to use that package and will add other logger and metrics functionalities along with it while implementing it. I think it's just like using a mongo client package and wrapping it with logger, metrics and tracer. |
also there is a question for @coolwednesday , i want to clarify that for OpenAI do i need to implement all of the endpoints or just the normal chat one. |
You can go ahead and build a wrapper around it. |
@coolwednesday And for the last doubt? I think it would be enough to cover main endpoints like chat, image, audio, files, etc. |
I think we can skip audio, images ..... Can you brief me on what do the models and moderation endpoints do ? |
Models is used to list and describe various models available in the api Moderations is used to classify if any given input content is harmful across several categories. Basically monitoring requests so can be tracked using request id. (can be used to log requests but increases api call). |
I want to use this feature to integrate AI with the observability, that GoFr provides. For this, we’ll likely need features like chat, embedding conversion, fine-tuning, batch processing, models, and moderation. We can skip audio and image-related features for now. You don't need to implement all the endpoints that I discussed. Let’s start small and explore how these features depend on each other. Try to implement a few related ones together in a single pull request (PR). |
@coolwednesday @vikash i have wrapped chat endpoint and now will be writing tests, but before that i wanted to know about mock files that different datasources have implemented like |
These mock files exist because the datasource clients incorporate observability features—traces, metrics, and logs—into each of their methods. When writing tests, we not only mock the underlying methods being called but also need to set up mock expectations for logger, metrics. To achieve this, the respective interfaces for these observability components (e.g., logger and metrics) are defined, and their mock implementations are created. This is where files like mock_logger.go and mock_metrics.go come into play. The reason for this setup is that, in GoFr, datasource clients are assigned the original GoFr app's logger, metrics, and traces only when the user specifies the necessary configs and calls the addDatasource method on the app. This can be seen in the external_db.go file. For the chat client, a similar approach will be required: define interfaces for logger and metrics (traces, if invoked without initialization, do not cause a panic), create their corresponding mocks, and set them up correctly during testing. |
@coolwednesday I completed implementing the chat endpoint but , getting a linter error and i am pretty much sure it's bug it gives that an imported package is not formatted. Error:
I am only getting this error in certain files even i have formatted all of them equal (orange ones are the one with this linter error) I searched this error but got no fruitful result |
No description provided.
The text was updated successfully, but these errors were encountered: