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

Adjust the azure model deployment name call corresponding to README #309

Merged
merged 11 commits into from
May 15, 2023
Merged

Conversation

zjy282
Copy link
Contributor

@zjy282 zjy282 commented May 11, 2023

According to the modification of #306, adjust the azure model deployment name call corresponding to README

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Merging #309 (12ddb93) into master (be253c2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #309   +/-   ##
=======================================
  Coverage   92.63%   92.63%           
=======================================
  Files          22       22           
  Lines         679      679           
=======================================
  Hits          629      629           
  Misses         37       37           
  Partials       13       13           

@sashabaranov
Copy link
Owner

Thank you for the PR!

README.md Outdated
config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint ", "your Model deployment name")
config := openai.DefaultAzureConfig("your Azure OpenAI Key", "https://your Azure OpenAI Endpoint")
config.AzureModelMapperFunc = func(model string) string {
azureModelMapping = []string{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! Could you please comment out the config.AzureModelMapperFunc section and clearly indicate that it is optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, great idea

…l deployment name call corresponding to README

#308

Add AzureModelMapperFunc custom function instructions
…l deployment name call corresponding to README

#308

Add AzureModelMapperFunc custom function instructions
@sonicrang
Copy link

I've try it in my application and it should be:

config.AzureModelMapperFunc = func(model string) string {
			azureModelMapping := map[string]string{
				defaultModelType: deploymentName,
			}
			return azureModelMapping[model]
		}

Modify variable type definition error
@zjy282
Copy link
Contributor Author

zjy282 commented May 13, 2023

我已经在我的应用程序中尝试过它,它应该是:

config.AzureModelMapperFunc = func(model string) string {
			azureModelMapping := map[string]string{
				defaultModelType: deploymentName,
			}
			return azureModelMapping[model]
		}

This problem has been fixed, thanks

@sashabaranov sashabaranov merged commit 83d03fc into sashabaranov:master May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants