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

Config behavior changed since v1.3.6? #95

Closed
PeterDaveHello opened this issue May 12, 2024 · 4 comments · Fixed by #97
Closed

Config behavior changed since v1.3.6? #95

PeterDaveHello opened this issue May 12, 2024 · 4 comments · Fixed by #97

Comments

@PeterDaveHello
Copy link
Contributor

I only get this error since v1.3.6, v1.3.5 works fine with the same configuration from the environment variable:

azure-openai     | 2024/05/12 06:35:30 Init from config file
azure-openai     | 2024/05/12 06:35:30 executable path: /app/azure-openai-proxy
azure-openai     | 2024/05/12 06:35:30 read config file error: open /app/config.yaml: no such file or directory
azure-openai     | panic: open /app/config.yaml: no such file or directory
azure-openai     |                                           
azure-openai     | goroutine 1 [running]:
azure-openai     | main.main()
azure-openai     |      github.com/stulzq/azure-openai-proxy/cmd/main.go:31 +0xfa
azure-openai exited with code 2
@PeterDaveHello
Copy link
Contributor Author

Checking https://github.com/stulzq/azure-openai-proxy/releases/tag/v1.3.6, maybe this is related?

feat: optimize read config file
e3cd102

@PeterDaveHello
Copy link
Contributor Author

My docker-compose.yml:

  azure-openai:
    image: stulzq/azure-openai-proxy:v1.3.5
    ports:
      - 8080:8080
    environment:
      AZURE_OPENAI_ENDPOINT: https://<aoai-deployment>.openai.azure.com/

@PeterDaveHello
Copy link
Contributor Author

After tracing the code, it seems AZURE_OPENAI_MODEL_MAPPER can't be empty, but the behavior doesn't change here, just the error handling in new versions:

	err := azure.Init()
	if err != nil {
		panic(err)
	}

@PeterDaveHello
Copy link
Contributor Author

PeterDaveHello commented May 12, 2024

As AZURE_OPENAI_MODEL_MAPPER doesn't seem to be required, maybe we can change the logic of this line?

if endpoint != "" && openaiModelMapper != "" {

https://github.com/stulzq/azure-openai-proxy/blob/v1.3.8/azure/init.go#L34-L43

PeterDaveHello added a commit to PeterDaveHello/azure-openai-proxy that referenced this issue May 12, 2024
Modify the initialization condition in `azure/init.go` to allow the
`openaiModelMapper` environment variable to be optional. This change
facilitates configurations where the model mapper is not needed, and
improving flexibility.

Resolves: stulzq#95
stulzq pushed a commit that referenced this issue May 23, 2024
Modify the initialization condition in `azure/init.go` to allow the
`openaiModelMapper` environment variable to be optional. This change
facilitates configurations where the model mapper is not needed, and
improving flexibility.

Resolves: #95
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 a pull request may close this issue.

1 participant