GoogleCloudPlatform / GoogleCloudPlatform/python-docs-samples

[generative_ai]: Function calling with OpenAI samples are not working anymore.

Offen
#12,996 0 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @msampathkumar Auf GitHub ansehen
priority: p2 samples triage me type: bug
Vorherrschende Sprache
Jupyter Notebook
Sterne
8.1k
Forks
6.7k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
16

Beschreibung

## In which file did you encounter the issue?
[generative_ai/function_calling/test_function_calling.py](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/generative_ai/function_calling/test_function_calling.py)

## Did you change the file? If so, how?

No.

## Describe the issue

Both function calling with Open AI samples ([1](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/function-calling#python-openai), [2](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/function-calling#python-openai_1)) are no longer working ([CI build log](https://btx.cloud.google.com/invocations/d7d20dd6-a816-43dc-8513-51f897b73d7c/log)):

```
File "/workspace/generative_ai/function_calling/test_function_calling.py", line 59, in test_function_calling_basic
response = chat_function_calling_basic.generate_text()
File "/workspace/generative_ai/function_calling/chat_function_calling_basic.py", line 39, in generate_text
client = openai.OpenAI(
File "/workspace/generative_ai/function_calling/.nox/py-3-9/lib/python3.9/site-packages/openai/_client.py", line 122, in __init__
super().__init__(
File "/workspace/generative_ai/function_calling/.nox/py-3-9/lib/python3.9/site-packages/openai/_base_client.py", line 825, in __init__
self._client = http_client or SyncHttpxClientWrapper(
File "/workspace/generative_ai/function_calling/.nox/py-3-9/lib/python3.9/site-packages/openai/_base_client.py", line 723, in __init__
super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'proxies'

- generated xml file: /workspace/generative_ai/function_calling/sponge_log.xml -
=========================== short test summary info ============================
FAILED test_function_calling.py::test_function_calling_basic - TypeError: __i...
FAILED test_function_calling.py::test_function_calling_config - TypeError: __...
========================= 2 failed, 5 passed in 14.85s =========================
```

I noticed this issue when worked on https://github.com/GoogleCloudPlatform/python-docs-samples/pull/12811
There is a related discussion https://github.com/GoogleCloudPlatform/python-docs-samples/issues/12990 about missing regressions after the recent CI migration.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.