mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-18 18:53:10 +00:00
langchain-robocorp[minor]: Enable passing additional headers to the action server. (#21809)
Actions can optionally receive secrets via request headers. This PR enables this functionality.
This commit is contained in:
parent
09919c2cd5
commit
3b5ac44e03
@ -103,6 +103,8 @@ class ActionServerToolkit(BaseModel):
|
|||||||
"""Action Server URL"""
|
"""Action Server URL"""
|
||||||
api_key: str = Field(exclude=True, default="")
|
api_key: str = Field(exclude=True, default="")
|
||||||
"""Action Server request API key"""
|
"""Action Server request API key"""
|
||||||
|
additional_headers: dict = Field(exclude=True, default_factory=dict)
|
||||||
|
"""Additional headers to be passed to the Action Server"""
|
||||||
report_trace: bool = Field(exclude=True, default=False)
|
report_trace: bool = Field(exclude=True, default=False)
|
||||||
"""Enable reporting Langsmith trace to Action Server runs"""
|
"""Enable reporting Langsmith trace to Action Server runs"""
|
||||||
_run_details: dict = PrivateAttr({})
|
_run_details: dict = PrivateAttr({})
|
||||||
@ -226,6 +228,7 @@ class ActionServerToolkit(BaseModel):
|
|||||||
headers = {
|
headers = {
|
||||||
"Authorization": f"Bearer {self.api_key}",
|
"Authorization": f"Bearer {self.api_key}",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
**self.additional_headers,
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user