Skip to content

Commit

Permalink
feat(prompts): graphql types for tools, output_schema (#5849)
Browse files Browse the repository at this point in the history
* feat(prompts): graphql types for tools, output_schema

* fix types
  • Loading branch information
mikeldking committed Jan 9, 2025
1 parent b990be3 commit f304b77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
48 changes: 16 additions & 32 deletions src/phoenix/server/api/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,44 +604,28 @@ async def node(self, id: GlobalID, info: Info[Context, None]) -> Node:
tools=[
ToolDefinition(
definition={
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "A location in the world",
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"default": "fahrenheit",
"description": "The unit of temperature",
},
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "A location in the world",
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"default": "fahrenheit",
"description": "The unit of temperature",
},
"required": ["location"],
},
"required": ["location"],
},
}
)
],
output_schema=JSONSchema(
schema={
"type": "json_schema",
"json_schema": {
"type": "object",
"properties": {
"temperature": {"type": "number"},
"location": {"type": "string"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["temperature", "location", "unit"],
},
},
),
output_schema=None,
model_name="gpt-4o",
model_provider="openai",
)
Expand Down
1 change: 0 additions & 1 deletion src/phoenix/server/api/types/Prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ async def prompt_versions(
"description": "The unit of temperature",
},
},
"required": ["location"],
},
},
}
Expand Down

0 comments on commit f304b77

Please sign in to comment.