DSPy: The framework for programming—not prompting—language models
Python
fix: support default_headers in OpenAI LM Client
Narendranath Gogineni61c40e9ab588
diff --git a/dsp/modules/gpt3.py b/dsp/modules/gpt3.pyindex 4a7dbca26..69856b78f 100644--- a/dsp/modules/gpt3.py+++ b/dsp/modules/gpt3.py@@ -56,11 +56,13 @@ class GPT3(LM):model_type: Literal["chat", "text"] = None,system_prompt: Optional[str] = None,http_client: Optional[httpx.Client] = None,+ default_headers: Optional[dict[str, str]] = None,**kwargs,):super().__init__(model)self.provider = "openai"openai.api_type = api_provider+ openai.default_headers = default_headersself.system_prompt = system_prompt